Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.0k 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 Reply

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...