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]
CAEPE Continuous Deployment
Manage workloads on Kubernetes anywhere robustly and securely.
- Shores up security by simplifying deployment anywhere, supporting managed services, native Kubernetes, self-hosted, edge and secure airgapped deployment targets.
- Supports GitOps and provides guided, UI-driven workflows for all major progressive delivery strategies.
- Has RBAC built-in, providing inherent enterprise access control for who can deploy.
- Supports extended testing capabilities enabling your team to run different tests quickly and easily.