kubectl label: add page (#11090)

* kubectl label: add page

---------

Co-authored-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
pull/23/head
Aditya Shrivastav 2023-10-20 09:40:26 +05:30 committed by GitHub
parent eee1abc92c
commit 85fefa4444
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,24 @@
# kubectl edit
> Edit 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}}-`