Kubernetes label

A small key and value pair attached to an object, such as app=web, that other objects and commands use to find it.

In more detail

Labels are how a Service finds its pods and how a Deployment knows which pods it owns. They are meant to be queried, so keep them short and stable. Information that is only for people or tools, not for selection, belongs in an annotation.

Example

kubectl get pod web -n course-web --show-labels

Related terms

Taught in

References

Certification courses