Created
September 30, 2024 14:20
-
-
Save rjchicago/7c9f7fe1eeb4e7456431a2d1c1b7c9c6 to your computer and use it in GitHub Desktop.
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
| # Include all kube configs | |
| export KUBECONFIG=~/.kube/config$(for YAML in $(find ${HOME}/.kube -name '*.y*ml') ; do echo -n ":${YAML}"; done) | |
| # get pods per namespace | |
| alias kpns="kubectl get pods -A | sed 1d | awk '{print \$1}' | sort | uniq -c | sort -k1 -n -r" | |
| # get pods per node | |
| alias kpn="kubectl get pods -A -o jsonpath='{range .items[?(@.spec.nodeName)]}{.spec.nodeName}{\"\n\"}{end}' | sort | uniq -c | sort -rn" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment