You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/docs/tasks/administer-cluster/cpu-management-policies.md
+23-1Lines changed: 23 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,7 +46,8 @@ management policies to determine some placement preferences on the node.
46
46
### Configuration
47
47
48
48
The CPU Manager policy is set with the `--cpu-manager-policy` kubelet
49
-
option. There are two supported policies:
49
+
flag or the `cpuManagerPolicy` field in [KubeletConfiguration](/docs/reference/config-api/kubelet-config.v1beta1/).
50
+
There are two supported policies:
50
51
51
52
*[`none`](#none-policy): the default policy.
52
53
*[`static`](#static-policy): allows pods with certain resource characteristics to be
@@ -68,6 +69,27 @@ and `CPUManagerPolicyBetaOptions` feature gates. Diverging from the Kubernetes s
68
69
feature gates guard groups of options, because it would have been too cumbersome to add a feature
69
70
gate for each individual option.
70
71
72
+
### Changing the CPU Manager Policy
73
+
74
+
Since the CPU manger policy can only be applied when kubelet spawns new pods, simply changing from
75
+
"none" to "static" won't apply to existing pods. So in order to properly change the CPU manager
76
+
policy on a node, perform the following steps:
77
+
78
+
1.[Drain](/docs/tasks/administer-cluster/safely-drain-node) the node.
79
+
2. Stop kubelet.
80
+
3. Remove the old CPU manager state file. The path to this file is
81
+
`/var/lib/kubelet/cpu_manager_state` by default. This clears the state maintained by the
82
+
CPUManager so that the cpu-sets set up by the new policy won’t conflict with it.
83
+
4. Edit the kubelet configuration to change the CPU manager policy to the desired value.
84
+
5. Start kubelet.
85
+
86
+
Repeat this process for every node that needs its CPU manager policy changed. Skipping this
87
+
process will result in kubelet crashlooping with the following error:
88
+
89
+
```
90
+
could not restore state from checkpoint: configured policy "static" differs from state checkpoint policy "none", please drain this node and delete the CPU manager checkpoint file "/var/lib/kubelet/cpu_manager_state" before restarting Kubelet
91
+
```
92
+
71
93
### None policy
72
94
73
95
The `none` policy explicitly enables the existing default CPU
0 commit comments