Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kubelet: Enable setting cpuManagerPolicyOptions #2986

Merged
merged 1 commit into from
Apr 24, 2023

Conversation

stmcginnis
Copy link
Contributor

@stmcginnis stmcginnis commented Apr 6, 2023

Issue number:

Closes #2342

Description of changes:

This adds a new settings.kubernetes.cpu-manager-policy-options setting to allow configuring the kubelet cpuManagerPolicyOptions. When the CPU manager policy is set to "static", these options allow affecting the behavior of CPU allocation for pods.

The only supported policy option at this point is full-pcpus-only as it is the only one that is not hidden by an alpha feature gate. More options can be supported later as they leave alpha.

This change could have been included with #2930, but that PR is already getting quite large. So at this point it will probably be better dealing with merge conflicts than inflating that further. If one or the other doesn't make it in time for the next release they can also be divided up and updated to have the correct migration for their ultimate release version.

Testing done:

Deployed built image and applied these settings:

[settings.kubernetes]
cpu-manager-policy = "static"
cpu-manager-policy-options = [
  "full-pcpus-only"
]

Verified the /etc/kubernetes/kubelet/config file rendered as expected:

cpuManagerPolicy: static
cpuManagerPolicyOptions:
  full-pcpus-only: "true"

Checked systemctl status kubelet and made sure the service was healthy and reviewed logs to make sure kubelet was able to start up and recognize the new configuration.

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

@stmcginnis stmcginnis requested a review from bcressey April 6, 2023 19:12
README.md Show resolved Hide resolved
packages/kubernetes-1.24/kubelet-config Outdated Show resolved Hide resolved
@stmcginnis stmcginnis force-pushed the cpu-policy-options branch from 9a41e52 to 8661e6d Compare April 7, 2023 12:01
@stmcginnis
Copy link
Contributor Author

Rebased to resolve merge conflict with Release.toml 1.13.3 updates

@stmcginnis stmcginnis requested a review from gthao313 April 13, 2023 19:16
This adds a new `settings.kubernetes.cpu-manager-policy-options` setting
to allow configuring the kubelet cpuManagerPolicyOptions. When the CPU
manager policy is set to "static", these options allow affecting the
behavior of CPU allocation for pods.

Signed-off-by: Sean McGinnis <[email protected]>
@stmcginnis stmcginnis merged commit b1f7b44 into bottlerocket-os:develop Apr 24, 2023
@stmcginnis stmcginnis deleted the cpu-policy-options branch April 24, 2023 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support CPUManager policy options
4 participants