Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.8k views
in Technique[技术] by (71.8m points)

kubernetes - Error from server: error dialing backend: x509: certificate is valid for worker-0, not worker-0.australia-southeast1-a.c

When I try to exec into a Pod, it gives me the below error. Can somebody help?

Error from server: error dialing backend: x509: certificate is valid for worker-0, not worker-0.australia-southeast1-a.c.

NAME                          READY   STATUS    RESTARTS   AGE   IP            NODE       NOMINATED NODE   READINESS GATES
ubuntu-dep-78c894f7b7-qrgtb   1/1     Running   0          37m   10.200.0.31   worker-0   <none>           <none>
question from:https://stackoverflow.com/questions/65846914/error-from-server-error-dialing-backend-x509-certificate-is-valid-for-worker

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

This is a community wiki answer based on the comments above and posted for better visibility. Feel free to expand it.

kubectl exec command may override the hostname in the certificate and use FQDN instead. Adding the --hostname-override parameter to the kubelet config:

If non-empty, will use this string as identification instead of the actual hostname. If --cloud-provider is set, the cloud provider determines the name of the node (consult cloud provider documentation to determine if and how the hostname is used).

and restarting the service will fix the issue.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...