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
kubeadm: add support for patching a "kubeletconfiguration" target #110405
kubeadm: add support for patching a "kubeletconfiguration" target #110405
Conversation
/hold for review |
c3ea06c
to
0cba01d
Compare
With phases/kubelet/WriteConfigToDisk() about to support patches it is required that the function accepts an io.Writer where the PatchManager can output to and also a patch directory. Modify all call sites of the function WriteConfigToDisk() to properly prepare an pass an io.Writer and patches dir to it. This results in command phases for init/join/upgrade to pass the root io.Writer (usually stdout) and the patchesDir populated either via the config file or --patches flag.
In phases/kubelet/WriteConfigToDisk() create a patch manager for the root patches directory and apply the user patches with a target "kubeletconfiguration".
Document the "kubeletconfiguration" as a patch target in the v1beta3 API Init/JoinConfiguration.Patches struct and also for the --patches flag.
Allow passing the --patches flag to init/join/node phases relevant to the kubelet writing the config file on disk.
0cba01d
to
2134026
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: neolit123, SataQiu The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/lgtm |
@@ -421,8 +421,8 @@ type HostPathMount struct { | |||
type Patches struct { | |||
// Directory is a path to a directory that contains files named "target[suffix][+patchtype].extension". | |||
// For example, "kube-apiserver0+merge.yaml" or just "etcd.json". "target" can be one of | |||
// "kube-apiserver", "kube-controller-manager", "kube-scheduler", "etcd". "patchtype" can be one | |||
// of "strategic" "merge" or "json" and they match the patch formats supported by kubectl. | |||
// "kube-apiserver", "kube-controller-manager", "kube-scheduler", "etcd", "kubeletconfiguration". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason that we don't use kubelet-configuration
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tried to keep the name consistent with the original "kind" KubeletConfiguration -> kubeletconfiguration.
/hold |
/hold cancel |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Enhance the kubeadm "patches" functionality to be able to patch kubelet config files containing v1beta1.KubeletConfiguration before writing the kubelet config.yaml to disk during init/join/upgrade
Which issue(s) this PR fixes:
xref kubernetes/kubeadm#1682
Special notes for your reviewer:
Please review one commit at a time.
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: