Unable to connect to the server: x509: certificate is valid for x.x.x.x” error

If you have multiple interface IP addresses on your master node and configured kube api-server with one of them. You can receive the certification error, the reason is certification is not valid for the api-server IP address.

[email protected]:~# kubectl get pods -n kube-system
Unable to connect to the server: x509: certificate is valid for 10.96.0.1, 193.169.1.10, 193.169.1.10, not 10.0.2.15
[email protected]:~#

You must add the IP address with kubeadm init command for additional api-server serving certificate. This can be IP address or DNS Name.

[email protected] $ kubeadm init –apiserver-cert-extra-sans=$IP_ADDR,10.0.2.15

Series Navigation<< Unable to connect to the server: x509: certificate signed by unknown authority (possibly because of “crypto/rsa: verification error” while trying to verify candidate authority certificate “kubernetes”)Kubelet folder is missing on worker node >>