我正在尝试使用kubernetes-incubator/client-python
库连接到我的gke集群。我只运行一个基本查询:
from kubernetes import client, config
# Configs can be set in Configuration class directly or using helper utility
config.load_kube_config()
v1 = client.CoreV1Api()
print("Listing pods with their IPs:")
ret = v1.list_pod_for_all_namespaces(watch=False)
for i in ret.items:
print("%s\t%s\t%s" % (i.status.pod_ip, i.metadata.namespace, i.metadata.name))
我得到一个错误:
^{pr2}$我以为我的kube.config文件文件。所以我删除它并再次创建集群,以便重新创建一个新的kube.config文件文件。问题依然存在。你能帮我一下吗?在
这是你的云平台问题。找不到它们,您无法与服务交互。Here's some instructions关于如何设置这些。将
GOOGLE_APPLICATION_CREDENTIALS
环境变量指向凭据文件或通过SDK进行身份验证。在相关问题 更多 >
编程相关推荐