Get resource with custom columns
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 commands
-
kubectl patch deployment <name> -n <ns> -p '{"spec":{"replicas":2}}'Inline JSON patch without editing the whole manifest
-
kubectl annotate pod <pod> -n <ns> key=value --overwriteSet or update an annotation; --overwrite replaces existing value
-
kubectl label node <node> role=worker --overwriteAdd or change a label on any resource
-
kubectl taint nodes <node> key=value:NoSchedulePrevent pods without matching toleration from scheduling on node
-
kubectl taint nodes <node> key=value:NoSchedule-Remove a taint by appending a dash at the end