Skip to content

Instantly share code, notes, and snippets.

@joar
Created December 19, 2017 12:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joar/9960aa7c4045fe47d57c807ae7912d6c to your computer and use it in GitHub Desktop.
Save joar/9960aa7c4045fe47d57c807ae7912d6c to your computer and use it in GitHub Desktop.

kubectl snippets

List Pods by Node

$ kubectl get po -o json | jq -r '.items[] | ([.spec.nodeName, ": ", .metadata.name] | join(""))' | sort
node-foo: pod-foo
node-foo: pod-bar
node-bar: pod-baz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment