CPU Manager

Platform9 Managed Kubernetes - PMK release 5.0 includes support for Kubernetes Topology Manager and CPU Manager.

Traditionally, Kubernetes abstracts the details of pod scheduling from the user. By default, the kubelet implements pod CPU limitations by using CFS quotas. While this is desirable in most scenarios, there are workloads that require specific guarantees in terms of latency and performance. CPU Manager is a feature on kubelet that enables you to specify requirements of CPU allocations.

On a node, the CPU Manager is responsible for enabling enhanced workload policies. For example, depending on whether the pod is throttled and which CPU cores are available at scheduling time, it directs multiple CPU-intensive pods to share tasks to different CPU cores.

CPU Manager has been in beta since Kubernetes v1.12 and is enabled by default. The --cpu-manager-policy kubelet option is employed to define the CPU Manager policy. Two policies are supported:

  • None: This is the default policy. Here, the CPU manager treats all pods equally if the policy is unset or set to none.
  • Static: This policy grants enhanced CPU affinity and exclusivity to pods on the node with specific resource characteristics. It allows pods in the Guaranteed QoS class access to exclusive CPUs on the node if they have integer CPU requests . The amount of exclusively allocatable CPUs is equal to the total number of CPUs in the node, minus any CPU reservations by the kubelet's --kube-reserved or --system-reserved options.

These policies are configurable using the --cpu-manager-policy flag on kubelet.

Integration with Topology Manager

Topology Manager integrates the data from CPU Manager as well as other device plugins when making decisions about pod placement. Without topology manager, CPU Manager and Device Manager make decisions independently and this can result in pod placements that are undesirable.

Topology Manager with Platform9 Managed Kubernetes (PMK)

PMK now supports configuration of Topology Manager. The following fields are added to the cluster create API of qbert.

JSON
Copy

To enable CPU manager, simply set the cpuManagerPolicy field to static . Further, for reserving compute for the underlying node itself, reservedCPUs can be used. The CPUs specified in this field won't be used by kubelet for scheduling pods. Since Topology Manager works in conjunction with CPU Manager, it is advisable to configure it as well by following the configuration guide here.

Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard
  Last updated