Your handy guide of commonly used kubectl commands to display one or many resources when running commands against clusters. Click to copy to clipboard easily, or download the PDF cheatsheet as a useful reference.
Nodes
kubectl get no
kubectl describe no
kubectl get no -o wide
kubectl get no -o yaml
kubectl get no --show-labels
kubectl get no -l [label_name]
Namespaces
kubectl get ns
kubectl describe ns
kubectl get ns -o yaml
Pods
kubectl get po
kubectl describe po
kubectl get po -o wide
kubectl get po -o yaml
kubectl get po --show-labels
kubectl get po -l [label_name]
Deployments
kubectl get deploy
kubectl describe deploy
kubectl get deploy -o wide
kubectl get deploy -o yaml
kubectl get deploy --show-labels
kubectl get deploy -l [label_name]
DaemonSets
kubectl get no
kubectl describe no
kubectl get no -o wide
kubectl get no -o yaml
kubectl get no --show-labels
kubectl get no -l [label_name]
ReplicaSets
kubectl get ns
kubectl describe ns
kubectl get ns -o yaml
Services
kubectl get svc
kubectl describe svc
kubectl get svc -o wide
kubectl get svc -o yaml
kubectl get svc --show-labels
kubectl get svc -l [label_name]
RBAC
kubectl get serviceaccount
kubectl get serviceaccount -o yaml
kubectl get roles
kubectl get roles -o yaml
kubectl get rolebindings
kubectl get rolebindings -o yaml
kubectl get clusterroles
kubectl get clusterroles -o yaml
kubectl get clusterrolebindings
kubectl get clusterrolebindings -o yaml
kubectl get customresource
kubectl get customresource -o yaml
kubectl get customresourcedefinition
kubectl get customresourcedefinition -o y
kubectl auth reconcile -f my-rbac-rules.yaml
Secrets
kubectl get secrets
kubectl get secrets -o yaml
ConfigMaps
kubectl get cm
kubectl get cm -o yaml
StorageClass
kubectl get sc
kubectl get sc -o yaml
PersistentVolume
kubectl get pv
kubectl get pv -o yaml
PersistentVolumeClaim
ubectl get pvc
kubectl get pvc -o yaml
Ingress
kubectl get ingress
kubectl describe ingress
kubectl get ingress -o yaml
Applying and Updating Resources
kubectl apply -f [resource.yaml]
kubectl delete -f [resource.yaml]
Not keen to commit these commands to memory? Let CAEPE handle them for you. CAEPE is a Continuous Deployment platform purpose built for Kubernetes. CAEPE supports both push and pull approaches and fits seamlessly into your existing pipelines to simplify application deployment for Kubernetes.