Skip to content

Commit d2a2af2

Browse files
authored
Merge pull request #31721 from mac-chaffee/main
Add upgrade notes to cpu-management-policies
2 parents 288a7ad + d657a0d commit d2a2af2

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

content/en/docs/tasks/administer-cluster/cpu-management-policies.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ management policies to determine some placement preferences on the node.
4646
### Configuration
4747

4848
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:
5051

5152
* [`none`](#none-policy): the default policy.
5253
* [`static`](#static-policy): allows pods with certain resource characteristics to be
@@ -68,6 +69,27 @@ and `CPUManagerPolicyBetaOptions` feature gates. Diverging from the Kubernetes s
6869
feature gates guard groups of options, because it would have been too cumbersome to add a feature
6970
gate for each individual option.
7071

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+
7193
### None policy
7294

7395
The `none` policy explicitly enables the existing default CPU

0 commit comments

Comments
 (0)