Skip to content

Instantly share code, notes, and snippets.

@ldelelis
Created January 26, 2021 17:40
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 ldelelis/309c04cfb4edc407a1114efe4ceb0f2a to your computer and use it in GitHub Desktop.
Save ldelelis/309c04cfb4edc407a1114efe4ceb0f2a to your computer and use it in GitHub Desktop.
Print all pods on each instance of a given kubernetes node pool
#!/bin/sh
kubectl get node | grep $1 | awk '{print $1}' | while read instance; do printf "\ninstance: $instance\n======\n"; kubectl get po -A --no-headers --field-selector spec.nodeName=$instance; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment