-
Notifications
You must be signed in to change notification settings - Fork 716
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 should leverage kubelet automatic client cert rotation on nodes created with kubeadm init
#1753
kubeadm should leverage kubelet automatic client cert rotation on nodes created with kubeadm init
#1753
Comments
/assign fabriziopandini |
@lnovara i think the request is a reasonable one. |
so i did some investigation here and there are couple of options. let the kubelet manage this means that:
pros:
cons:
let the kubeadm manage
pros:
cons:
|
@neolit123 feel free to work on this issue
|
@fabriziopandini if we pivot no matter if certificate rotation is enabled or not, we need to dig into the kubelet configuration to understand if client cert rotation is enabled or not when a cert rotation is needed. What's kubelet behaviour when TLS bootstrap is enabled but client cert rotation is not? Is it even possibile to do TLS bootstrap without enabling client cert rotation? I think we should be consistent with the kubelet behaviour in this case. Just my 2 cents. |
true.
we can - i've tried it, but it will result in delay of the automatic creation of the Node object for this node. can be mitigated if the object is created by kubeadm.
from my experiments yesterday this is not possible. the kubelet needs valid client certs to authenticate with the api-server first, and only then we can use EDIT: actually reading this again, yes this is what we want to do but then there is a problem:
|
if the kubelet client cert rotation is disabled TLS boostrap still works. |
if we look at the approach if the user feeds their external and given we can only update this
both options seem not ideal. |
had a discussion about this with @fabriziopandini but first discuss it during a kubeadm meeting with the wider group. |
a PR is up for this: |
kubeadm init
we reverted the PR that merged for this with option1 from here: i will send a new PR when i have the time with option2. |
@neolit123 May I take this task? |
@jfbai this one is tricky and needs a lot of discussion. |
IC, thanks a lot. |
@neolit123, is it possible that implements auto-update the |
Newer versions of kubeadm have a "kubelet-finalize" phase for "init" that
does that automatically. I think we added that around 1.17, but you can
check the changelogs.
|
Sorry, missed the part about upgrade. I think its a bit tricky to do this
on upgrade because the user might have disabled cert rotation. You can
still execute the "kubelet-finalize" phase on demand.
|
I ran through the code and I think kubeadm want to decouple to kubelet so kubeadm guess the client cert rotation enabled or not by checking the The command |
Is this a BUG REPORT or FEATURE REQUEST?
FEATURE REQUEST
Versions
kubeadm version
kubeadm version: &version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.3", GitCommit:"2d3c76f9091b6bec110a5e63777c332469e0cba2", GitTreeState:"clean", BuildDate:"2019-08-26T15:59:52Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"darwin/amd64"}
What happened?
On master nodes,
/etc/kubernetes/kubelet.conf
gets created with "hardcoded"client-certificate/client-key
instead of pointing to/var/lib/kubelet/pki/kubelet-client-current.pem
as done on minions node.What you expected to happen?
I expected
/etc/kubernetes/kubelet.conf
to point to/var/lib/kubelet/pki/kubelet-client-current.pem
to leverage automatic kubelet client certificate rotation that is configured bykubeadm
How to reproduce it (as minimally and precisely as possible)?
kubeadm init && cat /etc/kubernetes/kubelet.conf
Anything else we need to know?
I already know this a chicken-and-egg problem but I think it would be really nice if the first master, after initialising the control plane, could make use of
/var/lib/kubelet/pki/kubelet-client-current.pem
to further streamline the certificates rotation process and avoid having to usekubeadm init kubeconfig kubelet
just on the master nodes to renew kubelet's client certificate.The text was updated successfully, but these errors were encountered: