Created
October 17, 2018 09:52
-
-
Save sokoow/f8f4dc84ca1eebacdd5f576e385e660b to your computer and use it in GitHub Desktop.
List JSON info about Kubernetes nodes
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
| #!/bin/bash | |
| node_num=$(kubectl get no -o json | tee nodes.json | jq ".items" | grep metadata | wc -l) && for i in $(seq 0 $(echo "$node_num - 1" | bc)); do cat nodes.json | jq ".items[$i].status.nodeInfo" && cat nodes.json | jq ".items[$i].status.allocatable"; done && rm nodes.json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment