Get resource with custom columns kubectl
Print only the fields you care about without jq
kubectl get pods -n <ns> -o custom-columns='NAME:.metadata.name,NODE:.spec.nodeName,STATUS:.status.phase'
more kubectl
all 73 commands →
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
Add taint to node
kubectl taint nodes <node> key=value:NoSchedule
Remove taint from node
kubectl taint nodes <node> key=value:NoSchedule-