Lesson 1.4

Namespaces and labels

Almost every relationship in Kubernetes is expressed as a label selector: services find pods, deployments find their pods, network policies find their targets.

9mIntermediate10.5k students

Overview

Labels are the query language

Almost every relationship in Kubernetes is expressed as a label selector: services find pods, deployments find their pods, network policies find their targets. Labels are not documentation, they are wiring.

Namespaces scope names and provide a boundary for quotas and access control. They do not isolate the network by default, which surprises people who assume separate namespaces cannot talk.

Adopt the recommended label conventions from the beginning. Retrofitting labels across a live cluster means touching every workload.

In this lesson you will:

  • Partition a cluster into namespaces
  • Use labels as the selection mechanism
  • Adopt a consistent labelling convention

Resources

Previous Lesson
Next Lesson
Namespaces and labels — Kubernetes for Application Developers — Vertex