Skip to content

Instantly share code, notes, and snippets.

@vreon
Last active August 29, 2015 14:27
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 vreon/df4156e38c92d3457b01 to your computer and use it in GitHub Desktop.
Save vreon/df4156e38c92d3457b01 to your computer and use it in GitHub Desktop.
#!/bin/bash
# k8s-status.sh: get a birds-eye view of a Kubernetes cluster
# For best results: watch -cn1 ./k8s-status.sh
green='\e[0;32m'
yellow='\e[0;33m'
purple='\e[0;35m'
cyan='\e[0;36m'
white='\e[0;37m'
reset='\e[0m'
section() {
echo -ne $3
echo "===== $2 ====="
kubectl get ${@:4} $1
echo -e $reset
}
section po 'PODS' $cyan $@
section rc 'REPLICATION CONTROLLERS' $purple $@
section svc 'SERVICES' $yellow $@
section ep 'ENDPOINTS' $green $@
section no 'NODES' $white $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment