Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
def test_kubernetes_pod_status_is_running(k8s_client):
podlist = k8s_client.list_namespaced_pod("default")
# Iterate through all the pods in the default namespace and verify that they are Running
for item in podlist.items:
pod = k8s_client.read_namespaced_pod_status(namespace='default',
print("%s\t%s\t" % (, item.metadata.namespace))
assert(pod.status.phase == "Running" )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment