Skip to content

Instantly share code, notes, and snippets.

@Prajithp
Created November 29, 2020 15:32
Show Gist options
  • Save Prajithp/90f293b91f5483d20ec2f1de7aa08938 to your computer and use it in GitHub Desktop.
Save Prajithp/90f293b91f5483d20ec2f1de7aa08938 to your computer and use it in GitHub Desktop.
kubectl eamples
kubectl get po --all-namespaces -o custom-columns=name:.metadata.name,status:.status.phase,image:'.spec.containers[0].image'
kubectl get po -o json --all-namespaces | jq '.items | group_by(.spec.nodeName) | map({"nodeName": .[0].spec.nodeName, "count": length}) | sort_by(.count)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment