Goglides Dev 🌱

Balkrishna Pandey
Balkrishna Pandey

Posted on

Set Kubelet CPUManager policy to static

In Openshift you can apply following configuration to set CPUManager policy to static,

apiVersion: machineconfiguration.openshift.io/v1
kind: KubeletConfig
metadata:
  annotations:
    machineconfiguration.openshift.io/mc-name-suffix: "2"
  name: cpumanager-enabled
spec:
  kubeletConfig:
    cpuManagerPolicy: static
    cpuManagerReconcilePeriod: 5s
  machineConfigPoolSelector:
    matchLabels:
      custom-kubelet: cpumanager-enabled

Enter fullscreen mode Exit fullscreen mode

Where you should have a machineConfigPool which matches the labels custom-kubelet: cpumanager-enabled.

Once you apply this label you can ssh into node and validate /etc/kubernetes/kubelet.conf file.

cat /etc/kubernetes/kubelet.conf | grep cpuManager
Enter fullscreen mode Exit fullscreen mode

Output:

  "cpuManagerPolicy": "static",
  "cpuManagerReconcilePeriod": "5s",
Enter fullscreen mode Exit fullscreen mode

Top comments (0)