error: couldn't read version from server

后端 未结 6 2153
旧巷少年郎
旧巷少年郎 2021-02-13 13:12

I am getting the following error when trying to run kubectl locally.

error: couldn\'t read version from server: Get http://localhost:8080/api: dial tc

6条回答
  •  鱼传尺愫
    2021-02-13 13:35

    This used to be beta, but that is no longer the case. So the command now is:

    gcloud container clusters get-credentials  --zone= --project=    
    

    If you try to run it with the beta command you get the following error message:

    WARNING: You invoked gcloud beta, but with current configuration Kubernetes Engine v1 API will be used instead of v1beta1 API. gcloud beta will switch to use Kubernetes Engine v1beta1 API by default by the end of March 2018.

    Later on if you wish to switch between clusters via kubectl (only for ones that you have already authenticated for), you can use:

    kubectl config use-context gke___
    

    Example:

    kubectl config use-context gke_my-project_europe-west1-c_my-cluster
    

    To see where you currently are:

    kubectl config current-context
    

    Cheers

提交回复
热议问题