1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-29 23:24:55 +02:00
tldr/pages/common/kubectl-label.md
Juri Dispan 9d383ade68
*: fix typos in command names (#11730)
* *: fix typos in command names

* command name fixes in other languages

* fix incorrectly translated commands

* change incorrect file name

* qm move disk alias pages

---------

Co-authored-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
2023-12-14 17:41:19 +05:30

600 B

kubectl label

Label Kubernetes resources. More information: https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#label.

  • Label a pod:

kubectl label pod {{pod_name}} {{key}}={{value}}

  • Update a pod label by overwriting the existing value:

kubectl label --overwrite {{pod_name}} {{key}}={{value}}

  • Label all pods in the namespace:

kubectl label pods --all {{key}}={{value}}

  • Label pod identified by pod definition file:

kubectl label -f {{pod_defination_file}} {{key}}={{value}}

  • Remove the label from a pod:

kubectl label pod {{pod_name}} {{key}}-