【问题标题】:Unable to connect to the server: dial tcp accounts.google.com :443: getsockopt: operation timed out无法连接到服务器:拨打 tcp accounts.google.com :443: getsockopt: operation timed out
【发布时间】:2018-02-13 21:33:55
【问题描述】:

我正在尝试从 gcloud 项目中获取 pod 列表。

我使用不同的笔记本电脑在gcp 创建的 gcloud 项目。 现在我使用不同的机器,但登录到相同的gcp 帐户并使用相同的项目。

当我运行命令kubectl get pods 时,出现以下错误。

Unable to connect to the server: dial tcp a.b.c.d:443: getsockopt: operation timed out

我尝试添加一个参数--verbose,但这似乎无效。

如何进一步解决此错误。

【问题讨论】:

    标签: kubernetes gcloud google-kubernetes-engine


    【解决方案1】:

    gcloud container clusters get-credentials my-cluster-name 会将您登录到本地集群

    来自文档: “使用适当的凭据和端点信息更新 kubeconfig 文件,以将 kubectl 指向 Google Kubernetes Engine 中的特定集群。” - src

    【讨论】:

    • Chainlink - 这确实解决了错误,现在我可以看到kubectl get pods 结果。能否请您早点告诉我是什么导致了这个问题?
    猜你喜欢
    • 2021-11-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-04-18
    • 2019-10-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多