【发布时间】:2019-11-08 04:07:18
【问题描述】:
我正在制作一个使用 K8S (EKS) 来编排集群上的部署的应用程序。目前,我正在使用 Minikube 进行开发,所以它按预期进行,但它使用 $HOME/.kube/config 文件来加载配置。连接 EKS 的其他方式有哪些?
我用于工作证明的示例代码:
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))
【问题讨论】:
-
您是否尝试从另一个 kubernetes 集群访问?还是一个位置的多个 Kubernetes 集群?
标签: python kubernetes amazon-eks