问题描述
我正在尝试从gcloud项目中获取豆荚列表.
I'm trying to get the pods list from the gcloud project.
我在gcp
中使用其他笔记本电脑创建的gcloud项目.现在,我使用的是另一台计算机,但登录了相同的gcp
帐户并使用了相同的项目.
The gcloud project I've created in the gcp
using different laptop.Now I'm using different machine but logged into same gcp
account and using same project.
当我运行命令kubectl get pods
时,出现以下错误.
When I run the command kubectl get pods
I get the below error.
Unable to connect to the server: dial tcp a.b.c.d:443: getsockopt: operation timed out
我试图添加一个参数--verbose
,但这似乎无效.
I tried to add an argument --verbose
but that doesn't seems to be valid.
如何进一步解决该错误.
How can I further proceed in resolving this error.
推荐答案
gcloud container clusters get-credentials my-cluster-name
会将您本地登录到群集中
gcloud container clusters get-credentials my-cluster-name
will log you into your cluster locally
从文档中:使用适当的凭据和端点信息更新kubeconfig文件,以将kubectl指向Google Kubernetes Engine中的特定群集." - src
From the docs:"updates a kubeconfig file with appropriate credentials and endpoint information to point kubectl at a specific cluster in Google Kubernetes Engine." - src
这篇关于无法连接到服务器:拨打tcp accounts.google.com:443:getsockopt:操作超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!