Unable to connect to the server: dial tcp i/o time out

前端 未结 10 1426
死守一世寂寞
死守一世寂寞 2021-02-06 21:52

When i run the kubectl version command , I get the following error message.

kubectl version
Client Version: version.Info{Major:\"1\", Minor:\"9\", GitVersion:\"v         


        
相关标签:
10条回答
  • 2021-02-06 22:09

    i checked the firewall port and it was closed, i opened it and it started working.

    0 讨论(0)
  • 2021-02-06 22:10

    This problem occurs because of minikube. Restart minikube will solve this problem.Run below command and it will work-

    minikube stop
    minikube delete
    minikube start
    
    0 讨论(0)
  • 2021-02-06 22:10

    Was facing the same problem with accessing GKE master from Google Cloud Shell.

    Then I followed this GCloud doc to solve it.

    1. Open GCloud Shell

    2. Get External IP of the current GCloud Shell with:

      dig +short myip.opendns.com @resolver1.opendns.com

    3. Add this External IP into the "Master authorized networks" section of the GKE cluster - with a CIDR suffix of /32

    After that, running kubectl get nodes from the GCloud Shell worked right away.

    0 讨论(0)
  • 2021-02-06 22:14

    You have to run first

    minikube start
    

    on your terminal. This will do following things for you:

     Restarting existing virtualbox VM for "minikube" ...
    ⌛  Waiting for SSH access ...
                                                                        
    0 讨论(0)
  • 2021-02-06 22:17

    If you are using azure and have recently changed your password try this:

    az account clear
    az login
    

    After logging in successfully:

    az aks get-credentials --name project_name --resource-group resource_group_name
    

    Now when you run

    kubectl get nodes
    

    you should see something. Also, make sure you are using the correct kubectl context.

    0 讨论(0)
  • 2021-02-06 22:23

    If you use minikube then you should run, kubectl config use-context minikube If you use latest docker for desktop that comes with kubernetes then you should run, kubectl config use-context docker-for-desktop

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