CKAD Prep Part 11 – Labels, Selectors & Annotations
Kubernetes - Labels, Selectors & Annotations Labels Labels are key/value pairs that are used to add metadata to Kubernetes objects. They can be used to select and group subsets of objects in the cluster. Labels are added to an object in the metadata.labels section of the object descriptor as shown in the two Pod definitions below. apiVersion: v1 kind: Pod metadata: name: dev-pod labels: app: my-service environment: dev spec: containers: - name: nginx-container image: nginx imagePullPolicy: Always apiVersion: v1 kind: Pod metadata: name: prod-pod labels: app: my-service environment: prod spec: containers: - name: nginx-container image: nginx imagePullPolicy: Always After creating the above Pods run kubectl [...]