Skip to content
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

Improvement for k8s.io/docs/tasks/administer-cluster/kubeadm/kubeadm-certs/ #15292

Closed
dbowling opened this issue Jul 4, 2019 · 2 comments
Closed
Labels
sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle.

Comments

@dbowling
Copy link

dbowling commented Jul 4, 2019

Regarding the Kubelet certificate renewal, the documentation says:

Note: kubelet.conf is not included in the list above because kubeadm configures kubelet for automatic certificate renewal.

I've just run through the kubeadm upgrade process (from 1.14.2 to 1.15.0) and I don't see that my kubelet certificate was rotated (it still shows the old date, which expires in under 1 month from now, rather than a year out.)

Some extra guidance in the documentation regarding how to get this certificate rotated when managing by kubeadm would be of great help.

Since kubeadm alpha certs check-expiration doesn't include the kubelet, I'm using the following command to review the expiration: echo -n | openssl s_client -connect localhost:10250 2>&1 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | openssl x509 -text -noout | grep Not

@neolit123
Copy link
Member

the client certificate for the kubelet should automatically rotate for you.

this is managed by a specific certificate manager created inside the kubelet and kubeadm makes sure to enable this feature for you.

AFAIK, the decision on when to rotate the certificate is non-deterministic and it may happen 70 - 90% of the total lifespan of the certificate to prevent overlap on node cert rotations. 1 month before expiration seems odd, so if you find a bug make sure you log an issue in kubernetes/kubernetes and tag /sig node auth

if you wish to force the kubelet client certificate rotation you can try:

sudo mv /var/lib/kubelet/pki /var/lib/kubelet/pki-backup
sudo systemctl restart kubelet
# the pki folder should be re-created.

xref kubernetes/kubernetes#65991

cc @jimangel @fabriziopandini
/sig cluster-lifecycle

@k8s-ci-robot k8s-ci-robot added the sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. label Jul 4, 2019
@dbowling
Copy link
Author

dbowling commented Jul 5, 2019

Thanks @neolit123. I was expecting it to rotate on update or restart of the kubelet, but since that's not the case I've manually performed the restart after deleting the pki folder and it now reports having an updated certificate. I'll close this issue. If it doesn't update in the future, I'll know there's a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle.
Projects
None yet
Development

No branches or pull requests

3 participants