【问题标题】:Google cloud kubernetes unable to connect to cluster谷歌云 Kubernetes 无法连接到集群
【发布时间】:2019-02-11 21:00:55
【问题描述】:

当我在 google shell 中连接到我的集群时尝试运行 kubectl get pods 时收到 Unable to connect to the server: dial tcp <IP> i/o timeout。在我没有对集群设置进行任何更改的情况下,这突然开始了。

gcloud beta container clusters create tia-test-cluster \
    --create-subnetwork name=my-cluster\
    --enable-ip-alias \
    --enable-private-nodes \
    --master-ipv4-cidr <IP> \
    --enable-master-authorized-networks \
    --master-authorized-networks <IP> \
    --no-enable-basic-auth \
    --no-issue-client-certificate \
    --cluster-version=1.11.2-gke.18 \
    --region=europe-north1 \
    --metadata disable-legacy-endpoints=true \
    --enable-stackdriver-kubernetes \
    --enable-autoupgrade

这是当前的集群配置。 在执行此操作之前,我也运行过 gcloud container clusters get-credentials my-cluster --zone europe-north1-a --project &lt;my project&gt;

我还注意到我的计算实例丢失了它们的外部 IP。在我们的暂存环境中,一切都基于相同的配置正常运行。

任何指针将不胜感激。

【问题讨论】:

    标签: kubernetes google-cloud-platform google-kubernetes-engine


    【解决方案1】:

    从我看到的你发布的内容来看,你已经为网络 &lt;IP&gt; 开启了主授权网络。

    如果 Google Cloud Shell 的 IP 地址发生变化,这正是您所期望的错误。

    根据https://cloud.google.com/kubernetes-engine/docs/how-to/private-clusters#cloud_shell:您需要更新允许的IP地址。

    gcloud container clusters update tia-test-cluster \
        --region europe-north1 \
        --enable-master-authorized-networks \
        --master-authorized-networks [EXISTING_AUTH_NETS],[SHELL_IP]/32
    

    【讨论】:

      猜你喜欢
      • 2019-06-10
      • 1970-01-01
      • 2020-04-02
      • 2020-06-10
      • 1970-01-01
      • 2020-08-15
      • 2021-10-05
      • 2018-11-02
      • 2023-01-26
      相关资源
      最近更新 更多