Kubernetes Error: Error in configuration: unable to read client-cert* unable to read client-key*

System environment:

Ubuntu 20.04 LTSDocker 20.10.8Kubernetes 1.22.1Node: node

Execute command:

$ kubectl version

Errors are reported as follows:

Error in configuration: 
* unable to read client-cert /var/lib/kubelet/pki/kubelet-client-current.pem for default-auth due to open /var/lib/kubelet/pki/kubelet-client-current.pem: no such file or directory
* unable to read client-key /var/lib/kubelet/pki/kubelet-client-current.pem for default-auth due to open /var/lib/kubelet/pki/kubelet-client-current.pem: no such file or directory

Error reporting Description:

The token on the node has expired.

Solution:

$ kubeadm token create --print-join-command

kubeadm join 192.168.50.51:6443 --token rt43m1.b9py8ba6uxbfv7sr --discovery-token-ca-cert-hash sha256:f57a09633cf0e18cd905d41159a790704502410fd841acd63cffc8e493ad3cb2 

Regenerate the token on the Master node.

$ kubeadm join 192.168.50.51:6443 --token rt43m1.b9py8ba6uxbfv7sr --discovery-token-ca-cert-hash sha256:f57a09633cf0e18cd905d41159a790704502410fd841acd63cffc8e493ad3cb2 
$ kubectl version

Re execute on the node node.

Read More: