How to add a label?

090

To add a label to a pod in Kubernetes, you can use the following command:

kubectl label pods <pod-name> <label-key>=<label-value>

Example

If you want to add a label environment with the value production to a pod named nginx-deployment-xxx-yyy, you would run:

kubectl label pods nginx-deployment-xxx-yyy environment=production

Notes

  • Replace <pod-name> with the actual name of your pod.
  • You can add multiple labels by separating them with spaces.

If you have any more questions or need further assistance, feel free to ask!

0 Comments

no data
Be the first to share your comment!