Annotate resource

Set or update an annotation; --overwrite replaces existing value

kubectl annotate pod <pod> -n <ns> key=value --overwrite

tool
kubectl73 commands
tags
config

More kubectl commands

  • kubectl label node <node> role=worker --overwrite

    Add or change a label on any resource

  • kubectl taint nodes <node> key=value:NoSchedule

    Prevent 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

  • kubectl set image deployment/<name> <container>=image:tag -n <ns>

    Rolling-update the container image without editing YAML

  • kubectl rollout history deployment/<name> -n <ns>

    Show all revisions with change cause (requires --record or annotations)

all 73 kubectl commands