Show custom columns
Prints only the fields you need, no jq required
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}}'Changes one field with an inline JSON patch, without editing the whole manifest
-
kubectl annotate pod <pod> -n <ns> key=value --overwriteAdds or updates an annotation; --overwrite replaces the existing value
-
kubectl label node <node> role=worker --overwriteAdds or changes a label on any resource, here on a node
-
kubectl taint nodes <node> key=value:NoSchedulePods without a matching toleration will not be scheduled on this node
-
kubectl taint nodes <node> key=value:NoSchedule-Removes the taint; all the magic is in the dash at the end