did you specify the right host or port? error on Kubernetes

后端 未结 19 1837
北恋
北恋 2020-12-13 12:12

I have followed the helloword tutorial on http://kubernetes.io/docs/hellonode/.

When I run:

kubectl run hello-node --image=gcr.io/PROJECT_ID/hello-node         


        
19条回答
  •  無奈伤痛
    2020-12-13 12:36

    I was getting an error when running

    sudo kubectl get pods
    The connection to the server localhost:8080 was refused - did you specify the right host or port?
    

    Finally for my environment this command parameter works

    sudo kubectl --kubeconfig /etc/kubernetes/admin.conf get pods
    

    when executing kubectl as non root.

提交回复
热议问题