I'm new in K8s and I'm facing a problem with certificate. 1.13 version is used. One of the worker nodes is in NotReady status. I check logs and it turned out that:
Part of the existing bootstrap client certificate is expired
Using bootstrap kubeconfig to generate TLS client cert, key and kubeconfig file
Loading cert/key pair from "/var/lib/kubelet/pki/kubelet-client-current.pem"
Failed to connect to apiserver: the server has asked for the client to provide credentials
I checked and indeed kubelet-client-current.pem is pointing to expired certificate. My question is how to renew this kubelet-client-<current_date>.pem file.
EDIT:
I read that for this current cert:
The initial validity period is one year. When the certificate is about to expire, it is automatically renewed and the validity period is extended by one year.
Is there any way to create it manually? Or how to force kubeadm to do it?
I also deleted /var/lib/kubelet/pki and after kubelet restart it was recreated but only with kubelet-client.key.tmp, kubelet.crt, kubelet.key.
Finally I was able to renew this certificate. Solution is described under https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/troubleshooting-kubeadm/#kubelet-client-cert