What does this rule mean for app=web replicas?
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchLabels: { app: web }
topologyKey: kubernetes.io/hostname
- They always share one node
- No two land on the same node
- They only run on labelled nodes
- They evict other apps' pods
Hard anti-affinity on the hostname topology forbids scheduling a web pod onto a node that already runs one, so a node loss takes out one replica.
Play DevOps ▸