-
官方Python客户端库 for Kubernetes是python实现的
资源介绍
Kubernetes Python客户端
API的Python客户端。
安装
来自来源:
git clone --recursive https://github.com/kubernetes-client/python.git
cd python
python setup.py install
直接从 :
pip install kubernetes
例子
列出所有豆荚:
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 ( "
- 上一篇: flink-demo
- 下一篇: ETCD V3 java 完整例子