How to add lable for pods in yaml file.
# kubectl apply -f firstpods.yaml
# kubectl get pods -o wide --show-labels
# kubectl get pods --show-labels
# kubectl label pod <pod_name> <env=testing>
# kubectl get pods --show-labels
How to edit/replace name “env=testing” label to “env=prod”
label.
# kubectl edit pods nginxpod
# kubectl label --overwrite pod nginxpod env=prod
How to delete “env=testing” label.
# kubectl label pod nginxpod env-
How to add label for all pods.
No comments:
Post a Comment