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]

Roles

RoleBindings

kubectl get rolebindings -o 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 CAPE handle them for you. CAPE is a Continuous Deployment platform purpose built for Kubernetes. CAPE supports both push and pull approaches and fits seamlessly into your existing pipelines to simplify application deployment for Kubernetes.

download kubectl cheatsheet in pdf

Download the PDF version of this kubectl cheat sheet

Scroll to Top