How to remove a label kubectl label pod pod-with-labels env - Selecting Kubernetes Objects Using Label Selectors kubectl get pods -l app=nginx1 Kubectl label pod pod-with-labels team=dev org=abc Kubectl label pod pod-with-labels env=dev You can update the existing label or add the new one using below command kubectl label pod pod-with-labels app=nginx1 -overwrite We can do that using node-selector nodeSelector:ĭisktype: ssd Create a Pod with Labels kind: PodĬreate a pod kubectl create -f pod-with-labels.yaml kubectl describe pod pod-with-labels Adding Labels to a Running Pod This is a very basic requirement when you want to run your pod on a specific node because of its hardware/specific configuration etc. Project: k8s-infra Run a Pod on Specific Nodes You can organize pods so that each team will see only their pods.Organize Pods by team/project/organization With labels, you can also run your specific pods on selected nodes.Kubernetes internally maintains the mappings of labels to corresponding objects using optimized data structures to make these queries faster.We can attach the label at the time of creation or we can update it at runtime.key-value pair attached to the objects like pod.They are are the metadata which contain unique information of the Kubernetes objects.Select Kubernetes objects using Label selector.Clone this git repo for all the yaml files which we will be using in this blog.Kubernetes’ command-line tool, kubectl, which is the command-line interface for running commands against Kubernetes clusters.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |