Labels
● Labels are used to organize Kubernetes Objects such as Pods, nodes, etc.
● You can add multiple labels over the Kubernetes Objects.
● Labels are defined in key-value pairs.
● Labels are similar to tags in AWS or Azure where you give a name to filter the
resources quickly.
● You can add labels like environment, department or anything else according to you.
**Labels-Selectors
- **Once the labels are attached to the Kubernetes objects those objects will be filtered out with
- the help of labels-Selectors known as Selectors.
- The API currently supports two types of label-selectors equality-based and set-based. Label
- selectors can be made of multiple selectors that are comma-separated.
Node Selector
Node selector means selecting the nodes. If you are not aware of what is nodes. There are two types of nodes Master Nodes and Worker Nodes.
Master Nodes is responsible for the entire Kubernetes Cluster that communicates with the
Worker Node and runs the applications on containers smoothly. Master nodes can have multiple Worker Nodes.
Worker Nodes work as a mediator where the nodes communicate with Master nodes and run the applications on the containers smoothly.
So, the use of node selector is choosing the nodes which means on which worker node the command should be applied. This is done by Labels where in the manifest file, we mentioned the node label name. While running the manifest file, master nodes find the node
that has the same label and create the pod on that container. Make sure that the node must have the label. If the node doesn’t have any label then, the manifest file will jump to the next node.
Top comments (0)