Kubernetes concepts – labels

In the first example, you saw how creating a deployment also created a ReplicaSet and related pods, in order to run your software.

Kubernetes has a very flexible mechanism for connecting and referencing objects that it manages. Rather than having a very strict hierarchy of what can be connected, the Kubernetes project uses short, definitive key/value pairs as set of tags on resources, called labels. There is a matching mechanism to query and find related labels, called Selectors.

Labels are fairly strictly defined in format, and are intended to group together resources in Kubernetes. They are not intended to identify a single or unique resource. They can be used to describe relevant information about a set of ...

Get Kubernetes for Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.