Skip to content

Instantly share code, notes, and snippets.

@kadambkaluskar
Last active November 23, 2022 21:49
Show Gist options
  • Save kadambkaluskar/fe9413479d70d403c29f2c41cd1d2faf to your computer and use it in GitHub Desktop.
Save kadambkaluskar/fe9413479d70d403c29f2c41cd1d2faf to your computer and use it in GitHub Desktop.
  • List all pods with their priority-class:
    kubectl get pods --all-namespaces -o custom-columns=NAME:.metadata.name,PRIORITY:.spec.priorityClassName,VALUE:.spec.priority

  • List all pods with a specific priority-class:
    kubectl get pods -A -o=jsonpath='{.items[?(@.spec.priorityClassName=="system-node-critical")].metadata.name}{"\n"}'

  • List all pods running on a node:
    kubectl get pods --all-namespaces -o wide --field-selector spec.nodeName=<node_name>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment