Skip to content

Instantly share code, notes, and snippets.

@Ropes
Last active August 11, 2017 00:27
Show Gist options
  • 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