A Kubernetes label is a key-value pair attached to a resource, such as `app: frontend-webserver`. Labels identify attributes and organize resources without fixing group membership: a selector dynamically matches resources carrying the requested labels. A Service, for example, uses a selector to link to application Pods, whose IP addresses can change when they are replaced. section 3.2.6
Node labels also guide Pod placement. Label nodes that provide a capability, then set a matching `nodeSelector` in the workload. For a fast-disk node, run `kubectl label node <node-name> disk=fast` and specify `nodeSelector: {disk: fast}` in the Pod specification. Check node labels with `kubectl get nodes --show-labels` and Pod placement with `kubectl get pods -o wide`. section 3.2.7 section 3.4.1
A label attracts matching workloads; it does not prevent other Pods from using the node. To reserve GPU nodes for workloads that tolerate the restriction, use a taint as well as a label. A GPU Pod then needs both a matching node selector and a matching toleration. Node affinity offers label-based placement conditions beyond a simple node selector. section 3.2.7 section 3.4.1
Select a fast-disk node
Label a node `disk=fast`, then deploy a Pod with `nodeSelector: {disk: fast}`. In the placement example, the NGINX Pod reached `Running` on the labeled node. This demonstrates placement by capability, not exclusive use of that node. section 3.4.1
Labels can also select entire clusters for configuration delivery. In ACM, Cluster definitions carry labels such as `country: us` or `is-rollout-tester: true`; ClusterSelectors use those labels to target regional applications or test versions. Keep selectors for different versions nonoverlapping: if a general deployment also matches rollout testers, both deployments can apply to those clusters. section 11.3.3
apiVersion: v1 kind: Pod metadata: labels: run: nginx-gpu name: nginx-gpu spec: containers: - image: nginx name: nginx-gpu restartPolicy: Always nodeSelector: workload: gpu tolerations: - key: "workload" operator: "Equal" value: "gpu" effect: "NoSchedule"
The GPU Pod manifest shows the two distinct placement requirements together: `nodeSelector` matches the node label, while `tolerations` permits scheduling despite its taint. section 3.4.1
---
kind: ClusterSelector
apiVersion: configmanagement.gke.io/v1
metadata:
name: rollout-testers
spec:
selector:
matchLabels:
is-rollout-tester: true
---
kind: ClusterSelector
apiVersion: configmanagement.gke.io/v1
metadata:
name: non-testers
spec:
selector:
matchExpressions:
- key: is-rollout-tester
operator: DoesNotExist
---
kind: ClusterSelector
apiVersion: configmanagement.gke.io/v1
metadata:
name: country-us
spec:
selector:
matchLabels:
country: us
These ClusterSelectors show exact label matching for US clusters and separate expression-based selection for rollout testers and non-testers. section 11.3.3






