File tree Expand file tree Collapse file tree 3 files changed +11
-14
lines changed
Expand file tree Collapse file tree 3 files changed +11
-14
lines changed Original file line number Diff line number Diff line change 1414
1515import os
1616
17- import k8sclient
18- import k8sutil
17+ from kubernetes import client , util
1918
2019
2120def main ():
2221 # Configs can be set in Configuration class directly or using helper
2322 # utility
24- k8sutil .load_kube_config (os .environ ["HOME" ] + '/.kube/config' )
23+ util .load_kube_config (os .environ ["HOME" ] + '/.kube/config' )
2524
26- v1 = k8sclient .CoreV1Api ()
25+ v1 = client .CoreV1Api ()
2726 print ("Listing pods with their IPs:" )
2827 ret = v1 .list_pod_for_all_namespaces (watch = False )
2928 for i in ret .items :
Original file line number Diff line number Diff line change 1414
1515import os
1616
17- import k8sclient
18- import k8sutil
17+ from kubernetes import client , util
1918
2019
2120def main ():
2221 # Configs can be set in Configuration class directly or using helper
2322 # utility
24- k8sutil .load_kube_config (os .environ ["HOME" ] + '/.kube/config' )
23+ util .load_kube_config (os .environ ["HOME" ] + '/.kube/config' )
2524
26- v1 = k8sclient .CoreV1Api ()
25+ v1 = client .CoreV1Api ()
2726 count = 10
28- watch = k8sutil .Watch ()
27+ watch = util .Watch ()
2928 for event in watch .stream (v1 .list_namespace , timeout_seconds = 10 ):
3029 print ("Event: %s %s" % (event ['type' ], event ['object' ].metadata .name ))
3130 count -= 1
Original file line number Diff line number Diff line change 1414
1515import os
1616
17- import k8sclient
18- import k8sutil
17+ from kubernetes import client , util
1918
2019
2120def main ():
2221 # Configs can be set in Configuration class directly or using helper
2322 # utility
24- k8sutil .load_kube_config (os .environ ["HOME" ] + '/.kube/config' )
23+ util .load_kube_config (os .environ ["HOME" ] + '/.kube/config' )
2524
2625 print ("Supported APIs (* is preferred version):" )
2726 print ("%-20s %s" %
28- ("core" , "," .join (k8sclient .CoreApi ().get_api_versions ().versions )))
29- for api in k8sclient .ApisApi ().get_api_versions ().groups :
27+ ("core" , "," .join (client .CoreApi ().get_api_versions ().versions )))
28+ for api in client .ApisApi ().get_api_versions ().groups :
3029 versions = []
3130 for v in api .versions :
3231 name = ""
You can’t perform that action at this time.
0 commit comments