LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

kubectl-label

adds or updates labels on Kubernetes resources

TLDR

Add label to resource
$ kubectl label [pod/name] [key]=[value]
copy
Remove label
$ kubectl label [pod/name] [key]-
copy
Overwrite existing label
$ kubectl label --overwrite [pod/name] [key]=[newvalue]
copy
Label all pods with selector
$ kubectl label pods -l [app=myapp] [env]=[production]
copy

SYNOPSIS

kubectl label type/name key=value [options]

DESCRIPTION

kubectl label adds, updates, or removes labels on Kubernetes resources such as pods, nodes, services, and deployments. Labels are key-value metadata pairs that serve as the primary mechanism for organizing, grouping, and selecting resources throughout the Kubernetes ecosystem. They are used extensively by selectors in services, deployments, and network policies to determine which resources to target.To add a label, specify a key=value pair; to remove one, append a minus sign to the key name (e.g., `key-`). By default, overwriting an existing label requires the --overwrite flag to prevent accidental changes. The command can operate on individual resources, on all resources of a given type with --all, or on a filtered set matched by a label selector.

PARAMETERS

--overwrite

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

INSTALL

sudo apt install kubectl
copy
sudo pacman -S kubectl
copy
sudo apk add kubectl
copy
brew install kubectl
copy
nix profile install nixpkgs#kubectl
copy

SEE ALSO

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid