Skip to content

Instantly share code, notes, and snippets.

@Ropes
Last active August 11, 2017 00: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 Ropes/655a675d105ad68237488623ada200ba to your computer and use it in GitHub Desktop.
Save Ropes/655a675d105ad68237488623ada200ba to your computer and use it in GitHub Desktop.
Kubernetes Toolbelt

List CPU/Memory capacity of nodes

kubectl describe nodes | grep -A 2 -e "^\\s*CPU Requests"

kubectl describe nodes | egrep -A 2 "(^\\s*CPU Requests)|(^Name)"

List all Pods keyed by their host Node:

kubectl get pods -o json | jq 'reduce .items[] as $i ([]; . + [({($i.spec.nodeName): $i.metadata.name})])'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment