Created
July 11, 2022 04:37
-
-
Save efossas/4741758815cfd3f00dec11b55b1a40a8 to your computer and use it in GitHub Desktop.
View Node Capacity
This file contains 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
# capacity | |
capacity() { | |
echo "node cpu.capacity cpu.allocatable memory.capacity memory.allocatable" | awk '{printf "%-50s %-20s %-20s %-20s %-20s \n", $1, $2, $3, $4, $5}'; | |
kubectl get nodes -o json | jq -r '.items[] | "\(.metadata.name) \(.status.capacity.cpu) \(.status.allocatable.cpu) \(.status.capacity.memory) \(.status.allocatable.memory)"' | awk '{printf "%-50s %-20s %-20s %-20s %-20s \n", $1, $2, $3, $4, $5}'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment