kubectl-plugins

settags

Update image tags for named deployments across many namespaces.

Install kubectl-settags
curl -fsSL https://kubectl-plugins.dev/install.sh | sh -s -- settags
Download a binary insteadmacOS (Apple silicon) · macOS (Intel) · Linux (amd64) · Linux (arm64) · Windows (amd64)
Put the binary on your PATH as kubectl-settags, or build from source.
kubectl set-tags [-n NS[,NS...] | -A] [-f FILE] [--dry-run] [-y] NAME=TAG [NAME=TAG ...]

Finds every deployment whose name matches a NAME and changes the image tag to TAG. Only the tag is replaced; the repository is kept. Searches all namespaces unless -n is given.

If a deployment has several containers, those sharing the first container’s image repository are updated and the rest (sidecars) are left alone. A plan table is shown and confirmation is requested before anything changes.

Flags

FlagDescription
-n, --namespaceOnly these namespaces (comma-separated). Default: all
-A, --all-namespacesAll namespaces (the default; overrides -n)
-f, --fileFile with one NAME=TAG per line (# comments allowed)
--dry-runShow the plan and exit
-y, --yesSkip the confirmation prompt

Examples

kubectl set-tags api=v1.4.2 web=v2.0.0
kubectl set-tags -f tags.txt --dry-run
kubectl set-tags -n team-a,team-b -y api=v1.4.2