kubelet: Enable setting cpuManagerPolicyOptions #2986
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
Verified the
/etc/kubernetes/kubelet/config
file rendered as expected:Checked
systemctl status kubelet
and made sure the service was healthy and reviewed logs to make surekubelet
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.