LinuxCommandLibrary

kubectl-annotate

adds or updates annotations on Kubernetes resources

TLDR

Add annotation to resource

$ kubectl annotate [pod/mypod] [key]=[value]
copy
Remove annotation
$ kubectl annotate [pod/mypod] [key]-
copy
Overwrite existing annotation
$ kubectl annotate --overwrite [pod/mypod] [key]=[newvalue]
copy
Annotate all pods in namespace
$ kubectl annotate pods --all [key]=[value]
copy

SYNOPSIS

kubectl annotate [type/name] key=value [options]

DESCRIPTION

kubectl annotate adds or updates annotations on Kubernetes resources. Annotations are key-value pairs for storing metadata. Unlike labels, annotations are not used for selection but for tools and libraries.

PARAMETERS

--overwrite

Allow overwriting existing annotations.
--all
Select all resources of specified type.
--selector selector
Label selector for filtering.
-n, --namespace name
Kubernetes namespace.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community