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-labelsRelated terms
- label selector — A query that picks objects by their labels, such as every pod with app=web; controllers and Services depend on it.
- blue-green deployment — Running two complete environments, blue for the current release and green for the candidate, and switching traffic between them in one step.
- annotation — A key-value note attached to a Kubernetes object that tools read for extra configuration.
- Kubernetes object — A record stored in the cluster that describes one thing you want, such as a Pod, a Service or a Namespace.
Taught in
- What is GitOps? — Continuous Integration & Continuous Delivery Pipelines
- Rolling Updates and Rollbacks — Continuous Integration & Continuous Delivery Pipelines
- Blue-Green Deployments — Continuous Integration & Continuous Delivery Pipelines
- Canary Releases From Replica Counts — Certified Kubernetes Application Developer (CKAD) Exam Prep
- From Docker To Desired State — Kubernetes: Production-Grade Container Orchestration
- Namespaces, Labels And Declarative Manifests — Kubernetes: Production-Grade Container Orchestration
- Troubleshooting: describe, Events And A First Smoke Test — Kubernetes: Production-Grade Container Orchestration
- Deployments, ReplicaSets, Rollouts And Rollback — Kubernetes: Production-Grade Container Orchestration
- DaemonSets And Node Services — Kubernetes: Production-Grade Container Orchestration
- NetworkPolicy And The Consul Service Mesh Boundary — Kubernetes: Production-Grade Container Orchestration
- StatefulSets, Stable Identity And Data Recovery — Kubernetes: Production-Grade Container Orchestration
- Node Affinity, Pod Affinity And Topology Spread — Kubernetes: Production-Grade Container Orchestration