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

后端 未结 19 1683
北恋
北恋 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:38

    Reinitialising gcloud with proper account and project worked for me.

    gcloud init
    

    After this retrying the below command was successful and kubeconfig entry was generated.

    gcloud container clusters get-credentials "cluster_name"
    

    check the cluster info with

    kubectl cluster-info
    
    0 讨论(0)
  • 2020-12-13 12:42

    Just make sure to follow: https://cloud.google.com/container-engine/docs/before-you-begin before http://kubernetes.io/docs/hellonode/

    0 讨论(0)
  • 2020-12-13 12:43

    I had this problem using a local docker. The thing to do is check the logs of the containers its spins up to figure out what went wrong. For me it transpired that etcd had fallen over

       $ docker logs <etcdContainerId>
       <snip>
       2016-06-15 09:02:32.868569 C | etcdmain: listen tcp 127.0.0.1:7001: bind: address already in use
    

    Aha! I'd been playing with Cassandra in a docker container and I'd forwarded all the ports since I wasn't sure which it needed exposed and 7001 is one of its ports. Stopping Cassandra, cleaning up the mess and restarting it fixed things.

    0 讨论(0)
  • 2020-12-13 12:43

    I have a smae issue. in my scenario there is kubernetes API server is not responding. so check you kubernetes API server and controller as well as.

    0 讨论(0)
  • 2020-12-13 12:45

    I had the same issue after a reboot, I followed the guide described here

    So try the following:

    $ sudo -i
    # swapoff -a
    # exit
    $ strace -eopenat kubectl version
    

    After that it works fine.

    0 讨论(0)
  • 2020-12-13 12:47

    I got the same trouble since nearly release, seem must use KUBECONFIG explicit

    sudo cp /etc/kubernetes/admin.conf $HOME/

    sudo chown $(id -u):$(id -g) $HOME/admin.conf

    export KUBECONFIG=$HOME/admin.conf

    0 讨论(0)
提交回复
热议问题