Skip to content

Commit

Permalink
List nodes accordingly to label.
Browse files Browse the repository at this point in the history
  • Loading branch information
Quving committed Apr 2, 2020
1 parent 91b9a15 commit 1723d05
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from kubernetes import client, config

label_selector = 'grid=testing'

# 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_node(label_selector=label_selector)

for node in ret.items:
print(node.metadata.name)

0 comments on commit 1723d05

Please sign in to comment.