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.

Deployments

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 --show-labels
kubectl get no -l [label_name]

Services

kubectl get svc --show-labels
kubectl get svc -l [label_name]

RBAC

kubectl get serviceaccount
kubectl get serviceaccount -o yaml
kubectl get rolebindings -o yaml
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 -o yaml

StorageClass

PersistentVolume

PersistentVolumeClaim

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.

Download the PDF version of this kubectl cheat sheet

Scroll to Top