5 Resource management

 

This chapter covers

  • How Kubernetes allocates the resources in your cluster
  • Configuring your workload to request just the resources it needs
  • Overcommitting resources to improve your cost/performance ratio
  • Balancing the Pod replica count with internal concurrency

Chapter 2 covered how containers are the new level of isolation, each with its own resources, and chapter 3 discussed the schedulable unit in Kubernetes, a Pod (which itself is a collection of containers). This chapter covers how Pods are allocated to machines based on their resource requirements and the information that you need to give the system so that your Pod will receive the resources that it needs. Knowing how Pods are allocated to nodes helps you make better architectural decisions around resource requests, bursting, overcommit, availability, and reliability.

5.1 Pod scheduling

The Kubernetes scheduler performs a resource-based allocation of Pods to nodes and is really the brains of the whole system. When you submit your configuration to Kubernetes (as we did in chapters 3 and 4), it’s the scheduler that does the heavy lifting of finding a node in your cluster with enough resources and tasks the node with booting and running the containers in your Pods (figure 5.1).

Figure 5.1 In response to the user-applied configuration, the scheduler creates Pod replicas on nodes.
05-01

5.1.1 Specifying Pod resources

5.1.2 Quality of service

5.1.3 Evictions, priority, and preemption

5.2 Calculating Pod resources

5.2.1 Setting memory requests and limits

5.2.2 Setting CPU requests and limits

5.2.3 Reducing costs by overcommitting CPU

5.2.4 Balancing Pod replicas and internal Pod concurrency

Summary

sitemap