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

Viewed 756

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 !

1 Answers

This should work:

kubectl label pods --selector=color=green app=green
Related