Skip to content

Commit

Permalink
Update example
Browse files Browse the repository at this point in the history
  • Loading branch information
mbohlool committed Nov 9, 2016
1 parent f85b9b2 commit 5eee52f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions examples/example1.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,15 @@
# Configs can be set in Configuration class directly or using helper utility
k8sutil.load_kube_config(os.environ["HOME"] + '/.kube/config')

k8sclient.configuration.debug = True

# Prior to python 3.4 hosts with ip-addresses cannot be verified for SSL. this
# utility function fixes that.
k8sutil.fix_ssl_hosts_with_ipaddress()

v1=k8sclient.CoreV1Api()
print "Listing pods with their IPs:"
ret = v1.list_core_v1_pod_for_all_namespaces(watch=False)
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)
print "%s\t%s\t%s" % (i.status.pod_ip, i.metadata.namespace, i.metadata.name)

0 comments on commit 5eee52f

Please sign in to comment.