Created
February 26, 2020 22:07
-
-
Save rms1000watt/f25c1c77ac76143d51ef5a0cad4961af to your computer and use it in GitHub Desktop.
Kubernetes Print all Pods per Node
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| rm k8s-nodes-pods.txt &> /dev/null | |
| for node in $(kubectl get nodes | grep -v NAME | cut -d' ' -f1); do | |
| kubectl describe node "${node}" | grep -A99999 Namespace | grep -B999999 "Allocated resources:" | grep -v Allocated | grep -v Namespace | grep -v "\-\-\-\-\-" | awk '{print "'"${node}"' " $0}' >> k8s-nodes-pods.txt | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment