-
Notifications
You must be signed in to change notification settings - Fork 715
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 alpha phase certs renew all should also update certs in KubeConfig files #1361
Comments
@MalloZup |
sounds good! thanks a lot. |
Hi, there is one more thing regarding this topic.
[kubeconfig] Using existing up-to-date KubeConfig file: "/etc/kubernetes/admin.conf"
[kubeconfig] Using existing up-to-date KubeConfig file: "/etc/kubernetes/kubelet.conf"
[kubeconfig] Using existing up-to-date KubeConfig file: "/etc/kubernetes/controller-manager.conf"
[kubeconfig] Using existing up-to-date KubeConfig file: "/etc/kubernetes/scheduler.conf" It does not check if certs are expired, so in my opinion To get the updated certs into the files one MUST remove the files upfront, than the log looks like: [kubeconfig] Wrote KubeConfig file to disk: "/etc/kubernetes/admin.conf"
[kubeconfig] Wrote KubeConfig file to disk: "/etc/kubernetes/kubelet.conf"
[kubeconfig] Wrote KubeConfig file to disk: "/etc/kubernetes/controller-manager.conf"
[kubeconfig] Wrote KubeConfig file to disk: "/etc/kubernetes/scheduler.conf" In my case I though I'm fine, but a few days later to static pods couldn't communicate due to outdated certificates. Best Regards |
Assigned to @MalloZup |
@MalloZup: GitHub didn't allow me to assign the following users: MalloZup. Note that only kubernetes members and repo collaborators can be assigned and that issues/PRs can only have 10 assignees at the same time. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
hi @adoerler thx for issue. Regarding the misleading info i have sent a PR kubernetes/kubernetes#73798. I will have a look on the rest of the issue once i have time. Thx for the time and precision of the issue |
@adoerler i have sent a DOC pr for your suggestion. Feel free to have a look tia 🚀 |
Hi @MalloZup, thanks for PR! I'm missing a sentence about the kubeconfig files, because
|
Thx. I didnt add the doc because I was thinking that actually we could renew Also kubeconfig files. The rest restarting pods we can delegate to user and write minimal doc. @fabriziopandini @lubomir @ereslibre I m missing something on this implementation ? Tia |
@MalloZup I have not a deep knowledge of how certs renewal works. Personally, I would like to clarify a little bit the overall history before taking actions - included what proposed above - :
but I leave final word to people more skilled than me in this area |
i think we should reserve time on a meeting to discuss what our recommended certs renewal policy should be. the page about certs management might need some extra detail: and we need to write a small guide, for single control plane clusters as a start at least. what users have been doing is figuring things out on their own: this is a sign that we need to add an official guide. |
/assign @ereslibre |
Our cluster with a couple hundreds users is stuck at the moment. Could I have a very quick guide what to do with expired cert? |
these are the only guides we have ATM. |
|
in 1.13 init phases have graduated to to parent init command: in 1.12 the flag should be there: 1.11 is soon going out of support. |
removing the lifecycle/active label. possible docs update ideas here: |
@neolit123 @fabriziopandini |
@tushar00jain rotation of CA cert is tracked in another issue #1350 |
@fabriziopandini i was looking at closing this ticket today as you were able to send PRs for the renewal parts. should the ticket be closed?
yes this is tracked in a separate issue, possibly needs discussion/docs in terms of what workarounds we should provide.
the 3 above should be done. |
/close |
@fabriziopandini: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Can someone please explain to me how was the "Even with Certificate Rotation enabled, kubelet.conf points to outdated certs" part addressed? The only issue linked that mentions this explicitly closed in favour of another issues which is closed with "I'm not sure if this an issue so open a new ticket if it is". |
a quick recap of a very very long discussion.
This second point already as of today works for all the nodes except the one where you run kubeadm init; kubernetes/kubernetes#84118 is going to fix that |
@fabriziopandini Thank you for this, it makes sense. For anyone else facing the issue of the certs in kubelte.conf being out of date between now and when the above is fixed I found this article helpful:
client-certificate: /var/lib/kubelet/pki/kubelet-client-current.pem
client-key: /var/lib/kubelet/pki/kubelet-client-current.pem |
@AndrewSav Thank you for this. I have used the promethes operator to monitor the cluster. I recently received an alert "Kubernetes API certificate is expiring in less than 7 days", I think it is related to this issue. I have updated the content of kubelet.conf on the master nodes. But I still get the alert. Do you have any suggestions? Tks. |
@tannh if you installed the cluster with kubeadm, use kubeadm to check the certs experation. Otherwise your issue is probably not related. |
this will also be in the release notes for 1.17. |
@adoerler I am still running old version of kubeadm, how can I update the kubelet.conf, admin.con, ... etc, after certificate renewal? I ran "kubeadm alpha certs renew all", which generated new certificates, then I need to edit all .conf under /etc/kubernetes, how? where exactly they should point? |
Hi @SuleimanWA , I cannot tell you what to do on a multi master env, I've had only single master in my setup. This is what I've done: First of all make sure to move existing conf files out of the way, because existing files will not get overwritten!
then update these files:
To apply the new certificates in the static system pods the easiest way for me was to simply reboot the master server. Don't forget copy Hope this helps Andreas |
Any idea how to run this command on 1.14.10? All I get is:
Then the docs say: Thanks |
Hi @provgregoryabdo, whats your BR Andreas |
@provgregoryabdo the
@adoerler thanks for the help! |
I know this thread is old, but just in case anyone comes looking at this I have an updated answer that saved me. I used "kubeadm certs renew all" to bring my system back to life.
|
@Antebios This is about old versions that don't support this feature, because it's alpha. So if you really want to help, it would be nice to offer a solution for older versions (such as 1.19) where |
FEATURE REQUEST
Versions
kubeadm version v1.12.5
Environment:
uname -a
): Linux node1 4.4.0-141-generic kubeadm shouldn't depend on a specific shell or binary inside the control plane image #167-Ubuntu SMP Wed Dec 5 10:40:15 UTC 2018 x86_64 x86_64 x86_64 GNU/LinuxWhat happened?
3 of my clusters are now 1 year old. As some certs are issued with 1 year validity the cluster stopped working properly. I've upgrade the clusters from 1.10.12 to 1.11.6 and 1.12.5 before the certificates reached their expiration date.
I've experienced several problems:
Even with Certificate Rotation enabled, kubelet.conf points to outdated certs
/var/lib/kubelet/pki/kubelet-client-current.pem
was rotated correctly, butclient-certificate
andclient-key
in/etc/kubernetes/kubelet.conf
still pointed to/var/lib/kubelet/pki/kubelet-client.*
client-certificate-data
andclient-key-data
in/etc/kubernetes/kubelet.conf
still contained the certificate which will outdate soon.client-certificate-data
andclient-key-data
on all nodes and all clusterssudo kubeadm alpha phase kubeconfig kubelet
to regenerate this file on Master and all Nodes!Certificate Rotation dos not update apiserver/etcd/front-proxy-client certs
The Command
kubeadm alpha phase certs renew all
does not update KubeConfig filessudo kubeadm alpha phase certs renew all
on master which renews all expired certs in/etc/kubernetes/pki
which is fine, BUT/etc/kubernetes/admin.conf
/etc/kubernetes/controller-manager.conf
/etc/kubernetes/scheduler.conf
sudo kubeadm alpha phase kubeconfig all --apiserver-advertise-address=x.x.x.x
kubectl -n kube-system delete pod kube-apiserver-mater
which does seem to work, but in reality the pod never got restarted - I had to stop and start the container with docker stop/start.What you expected to happen?
kubeadm alpha phase kubeconfig
should either restart the static pods after config has been written or inform the user to do so.Best regards
Andreas
The text was updated successfully, but these errors were encountered: