-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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] fix kubelet config bug for kubeadm init phase #76578
[kubeadm] fix kubelet config bug for kubeadm init phase #76578
Conversation
/assign @neolit123 |
6587834
to
b64c7e7
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.
thanks for the PR, tentative LGTM.
i think we should instead set the value in the KubeletConfiguration (component configuration).
the rest of the flags for settings are already supported in the KubeletConfiguration and should be moved to there as well.
/assign @fabriziopandini
@kubernetes/sig-cluster-lifecycle-pr-reviews
/assign @timothysc |
I'm going to defer to @fabriziopandini on this one, I know he was looking more broadly on a number of certs issues. |
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.
Thanks for tackling this @SataQiu !
We set that value via the component config:
externalkubeletcfg.Authentication.X509.ClientCAFile = kubeadmapiv1beta1.DefaultCACertPath |
What we should be doing is to ensure, that we use internalcfg.CertificatesDir
to get the path (rather than the const).
/hold
@rosti OK. Thank you for your explanation. I will try further. |
/assign @fabriziopandini |
b64c7e7
to
7734a80
Compare
@rosti |
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.
Thanks @SataQiu !
@@ -88,7 +91,7 @@ func DefaultKubeletConfiguration(internalcfg *kubeadmapi.ClusterConfiguration) { | |||
// Enforce security-related kubelet options | |||
|
|||
// Require all clients to the kubelet API to have client certs signed by the cluster CA | |||
externalkubeletcfg.Authentication.X509.ClientCAFile = kubeadmapiv1beta1.DefaultCACertPath | |||
externalkubeletcfg.Authentication.X509.ClientCAFile = fmt.Sprintf("%s/%s", strings.TrimSuffix(internalcfg.CertificatesDir, "/"), constants.CACertName) |
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.
Looks way better than before, however let's use filepath.Join
for the actual path construction.
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.
Thank you so much!
The code has been updated.
7734a80
to
5b74f3d
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.
Thanks @SataQiu !
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rosti, 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 |
/test pull-kubernetes-kubemark-e2e-gce-big |
/cc @neolit123 @timothysc |
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.
Thanks @SataQiu
/lgtm
/hold cancel |
What type of PR is this?
/kind bug
What this PR does / why we need it:
[kubeadm] fix kubelet config bug for kubeadm init phase.
Which issue(s) this PR fixes:
Fixes kubernetes/kubeadm#1493
Special notes for your reviewer:
Does this PR introduce a user-facing change?: