DELAPARRA
Index
Color
NL
Category: Kubernetes

label

Explained by Updated

What is label?

label: A key/value tag attached to objects. The glue of Kubernetes — Services, selectors, and tooling all match on labels. Labels are key and value tags attached to Kubernetes objects, such as app: web or env: production. They are how Kubernetes connects things. A Service finds its pods through a label selector. A Deployment knows which pods it manages through labels. kubectl get pods -l app=web filters by them, and monitoring tools use them to group data.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about label

What should you keep in mind with label?

Use a consistent set of labels across all your resources. Kubernetes recommends keys like app.kubernetes.io/name and app.kubernetes.io/component. Be careful when changing labels on a running Deployment: if the selector no longer matches, the connection between objects breaks. Selectors on Deployments cannot be changed at all after creation, so choose them carefully the first time.

What does an example of label look like?

metadata: labels: app: web tier: frontend env: prod

At a glance

CategoryKubernetes
Explained by
Updated

More Kubernetes terms

All terms starting with L

Skills

Download all skills (zip)

Manuals

Related services

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.