Labels, Selectors, and Annotations in Kubernetes

From the Kubernetes Essentials cheat sheet ยท Labels and Metadata ยท verified Aug 2026

Labels, Selectors, and Annotations

Attach queryable labels and descriptive annotations.

bash
kubectl label pod web env=prod
kubectl get pods -l env=prod
๐Ÿ“Œ Selectors connect controllers and Services to Pods
๐Ÿ’ก Use annotations for non-identifying metadata
๐Ÿ” Set-based selectors support in and notin
โš ๏ธ Changing selector labels can disconnect resources
labelsselectorsannotations

Continue with Kubernetes Essentials

Save the full cheat sheet or work through every related task.

Back to the full Kubernetes Essentials cheat sheet