Skip to content

Instantly share code, notes, and snippets.

@themoah
Created September 18, 2019 08:58
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 themoah/7931be830cfbfe9111b49090b2bd600d to your computer and use it in GitHub Desktop.
Save themoah/7931be830cfbfe9111b49090b2bd600d to your computer and use it in GitHub Desktop.
Kubectl useful cheatsheet.
# limits allocation per node
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'
kubectl run echo-http --image=themoah/go-http-echo:0.1 --port=8080
kubectl expose deployment demo-app --port=80 --type=NodePort
kubectl run my-shell --rm -i --tty --image ubuntu -- bash
kubectl exec -it shell-demo -- /bin/bash
kubectl explain service --recursive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment