我遵循了 http://kubernetes.io/docs/hellonode/ 上的 helloword 教程.
当我运行时:
kubectl run hello-node --image=gcr.io/PROJECT_ID/hello-node:v1 --port=8080
我得到:The connection to the server localhost:8080 was refused - did you specify the right host or port?
为什么命令行尝试连接到本地主机?
最佳答案
问题是您的 kubeconfig
不对。
要自动生成它,请运行:
gcloud container clusters get-credentials "CLUSTER NAME"
这对我有用。
关于kubernetes - 您是否指定了正确的主机或端口? Kubernetes 上的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36650642/