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

前端 未结 10 1423
死守一世寂寞
死守一世寂寞 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:24

    I got similar problem when I run

    $ kubectl version
    Client Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.11", GitCommit:"637c7e288581ee40ab4ca210618a89a555b6e7e9", GitTreeState:"clean", BuildDate:"2018-11-26T14:38:32Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"darwin/amd64"}
    Unable to connect to the server: dial tcp 192.168.99.100:8443: i/o timeout
    

    And here's how I tried and finally worked.

    I installed Docker Desktop on Mac (Version 2.0.0.3) firstly. Then I installed the kubectl with command

    $ brew install kubectl
    .....
    ==> Pouring kubernetes-cli-1.16.0.high_sierra.bottle.tar.gz
    Error: The `brew link` step did not complete successfully
    The formula built, but is not symlinked into /usr/local
    Could not symlink bin/kubectl
    Target /usr/local/bin/kubectl
    already exists. You may want to remove it:
      rm '/usr/local/bin/kubectl'
    
    To force the link and overwrite all conflicting files:
      brew link --overwrite kubernetes-cli
    
    To list all files that would be deleted:
      brew link --overwrite --dry-run kubernetes-cli
    
    Possible conflicting files are:
    /usr/local/bin/kubectl -> /Applications/Docker.app/Contents/Resources/bin/kubectl
    .....
    

    That doesn't matter, we have already got the kubectl. Then I install minikube with command

    $ brew cask install minikube
    ...
    ==> Linking Binary 'minikube-darwin-amd64' to '/usr/local/bin/minikube'.
    

提交回复
热议问题