Edit a live resource kubectl
Open resource in $EDITOR; changes applied on save
kubectl edit deployment/<name> -n <ns>
more kubectl
all 73 commands →
Verify RBAC permissions
kubectl auth can-i list pods --as=system:serviceaccount:<ns>:<sa> -n <ns>
Get resource with custom columns
kubectl get pods -n <ns> -o custom-columns='NAME:.metadata.name,NODE:.spec.nodeName,STATUS:.status.phase'
Patch resource field
kubectl patch deployment <name> -n <ns> -p '{"spec":{"replicas":2}}'
Annotate resource
kubectl annotate pod <pod> -n <ns> key=value --overwrite
Label resource
kubectl label node <node> role=worker --overwrite