Skip to content

Instantly share code, notes, and snippets.

@ragul28
Created January 11, 2020 09:25
Show Gist options
  • Save ragul28/9ada540f05b8eb9ca7fc724ab6bc0ac8 to your computer and use it in GitHub Desktop.
Save ragul28/9ada540f05b8eb9ca7fc724ab6bc0ac8 to your computer and use it in GitHub Desktop.
Useful kubectl commands for debug
  • kube current cluster info
kubectl config current-context
kubectl cluster-info
kubectl get events
  • kube top
kubectl top pod --all-namespaces
kubectl top node
  • kube view node
kubectl get nodes -o wide
  • k8s node resource request & limits stats
kubectl get nodes --no-headers | awk '{print $1}' | xargs -I {} sh -c 'echo {}; kubectl describe node {} | grep Allocated -A 5 | grep -ve Event -ve Allocated -ve percent -ve -- ; echo'
  • debug shell
kubectl run my-shell -i --tty --image ubuntu -- bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment