Check RBAC permissions
Checks if a ServiceAccount can list pods; change the verb and resource to check other actions
kubectl auth can-i list pods --as=system:serviceaccount:<ns>:<sa> -n <ns>
- tool
- kubectl73 commands
More kubectl commands
-
kubectl get pods -n <ns> -o custom-columns='NAME:.metadata.name,NODE:.spec.nodeName,STATUS:.status.phase'Prints only the fields you need, no jq required
-
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