- Attach metadata to Kubernetes objects
- Map organizational structures onto system objects in a loosely coupled fashion
- Selectors identifies a set of objects by labels (AND concatenated by default)
service.yaml
apiVersion: v1
kind: Service
spec:
selector:
app: todo
tier: frontend
spec:
...
deployment.yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: todo-app
labels:
app: todo
tier: frontend
spec: ...
- Add metadata as additional informations
apiVersion: v1
kind: Service
metadata:
annotations:
external-dns.alpha.kubernetes.io/hostname: todo-app.workshops.mikebild.com.
spec: ...