Patch resource field kubectl
Inline JSON patch without editing the whole manifest
kubectl patch deployment <name> -n <ns> -p '{"spec":{"replicas":2}}'
more kubectl
all 73 commands →
Annotate resource
kubectl annotate pod <pod> -n <ns> key=value --overwrite
Label resource
kubectl label node <node> role=worker --overwrite
Add taint to node
kubectl taint nodes <node> key=value:NoSchedule
Remove taint from node
kubectl taint nodes <node> key=value:NoSchedule-
Set image on deployment
kubectl set image deployment/<name> <container>=image:tag -n <ns>