Home Explore Blog CI



kubernetes

3rd chunk of `content/en/docs/tasks/administer-cluster/cpu-management-policies.md`
3e8b1b776644e14efde1f9b9c2bef63c8ddd912de67c8c360000000100000825
if the set of online CPUs changes on the node, the node must be drained and CPU manager manually reset by deleting the
state file `cpu_manager_state` in the kubelet root directory.
{{< /note >}}

### `none` policy configuration

This policy has no extra configuration items.

### `static` policy configuration

This policy manages a shared pool of CPUs that initially contains all CPUs in the
node. The amount of exclusively allocatable CPUs is equal to the total
number of CPUs in the node minus any CPU reservations by the kubelet `--kube-reserved` or
`--system-reserved` options. From 1.17, the CPU reservation list can be specified
explicitly by kubelet `--reserved-cpus` option. The explicit CPU list specified by
`--reserved-cpus` takes precedence over the CPU reservation specified by
`--kube-reserved` and `--system-reserved`. CPUs reserved by these options are taken, in
integer quantity, from the initial shared pool in ascending order by physical
core ID.  This shared pool is the set of CPUs on which any containers in
`BestEffort` and `Burstable` pods run. Containers in `Guaranteed` pods with fractional
CPU `requests` also run on CPUs in the shared pool. Only containers that are
both part of a `Guaranteed` pod and have integer CPU `requests` are assigned
exclusive CPUs.

{{< note >}}
The kubelet requires a CPU reservation greater than zero be made
using either `--kube-reserved` and/or `--system-reserved` or `--reserved-cpus` when
the static policy is enabled. This is because zero CPU reservation would allow the shared
pool to become empty.
{{< /note >}}

### Static policy options {#cpu-policy-static--options}

You can toggle groups of options on and off based upon their maturity level
using the following feature gates:
* `CPUManagerPolicyBetaOptions` default enabled. Disable to hide beta-level options.
* `CPUManagerPolicyAlphaOptions` default disabled. Enable to show alpha-level options.
You will still have to enable each option using the `CPUManagerPolicyOptions` kubelet option.

The following policy options exist for the static `CPUManager` policy:

Title: CPU Manager Policy Configurations and Options
Summary
This section describes the configurations for the `none` and `static` CPU manager policies. The `none` policy has no configurable items. The `static` policy manages a shared pool of CPUs, with exclusively allocatable CPUs determined by subtracting CPU reservations from the total CPUs. The Kubelet options `--kube-reserved`, `--system-reserved`, and `--reserved-cpus` control CPU reservations. It also explains how to toggle the groups of options using `CPUManagerPolicyBetaOptions` and `CPUManagerPolicyAlphaOptions` feature gates.