Search code examples
kuberneteskubectl

Kubernetes: list a node's all pods and pod statuses


I want to list a node's pods and pod statues, eg.

Node A
Pod1 Status
Pod2 Status

Node B
Pod1 Status
Pod2 Status

Is there a kubectl command I can use for this?


Solution

  • Try this:
    kubectl get pods -A --field-selector spec.nodeName=<node name> | awk '{print $2" "$4}'