Kubectl Cheatsheet

Kubectl Cheatsheet
Kubectl Cheatsheet Docs: https://kubernetes.io/docs/reference/kubectl/cheatsheet/ https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands https://erosb.github.io/post/json-patch-vs-merge-patch/ Viewing, Finding Resources Nodes # get node status confditions JSONPATH='{range .items[]}{@.metadata.name}: {range @.status.conditions[]}{@.type}={@.status}, {end}{"\n"}{end}' \ && kubectl get nodes -o jsonpath="$JSONPATH" # check node cpu / memory usage kubectl top pod # check node status kubectl describe nodes kubernetes-minion-emt8.c.myproject.internal # find out the most hight cpu cost pod of a node kubectl get po -A -owide | grep ${NODE_NAME} | awk '{print $1, $2}' | xargs -n2 kubectl top pod –no-headers -n $1 | sort –key 2 -nr | column -t # find out the most hight memory cost pod of a node kubectl get po -A -owide | grep ${NODE_NAME} | awk '{print $1, $2}' | xargs -n2 kubectl top pod –no-headers -n $1 | sort –key 3 -nr | column -t Pods # get resource sort by name kubectl get services –sort-by=.
Read more →

Kubernetes Cheatsheet

Kubernetes Cheatsheet
Kubernetes Useful Resource Templates / Snippets
Read more →