Reputation: 17689
Using the below command labels can be added to a pod.
kubectl label pod <pod-name> {key1=value1,key2=value2,key3=value3}
What is the best way to add or remove a label, say, [ env: dev ] from all pods running in a given namespace.
Upvotes: 0
Views: 2524
Reputation: 15548
...to add or remove a label, say, [ env: dev ] from all pods running in a given namespace.
Try:
kubectl label pods --namespace <name> --all env=dev
# <-- add
kubectl label pods --namespace <name> --all env-
# <-- remove
Upvotes: 1