How to re-label multiple pods in k8s with kubectl label?

10/9/2019

Trying to figure out , how to apply new label "app=green" to the pods that currently marked with "color=green" ?

Looks like I could not use "--field-selector" and I don not want to specify name of each pod in "kubectl label" command.

Thank you !

-- Andy
kubectl
kubernetes

1 Answer

10/9/2019

This should work:

kubectl label pods --selector=color=green app=green
-- Burak Serdar
Source: StackOverflow