$ ./guess_the_languageDevOps
DevOps · hard · #250

What does this rule mean for app=web replicas?

podAntiAffinity:
  requiredDuringSchedulingIgnoredDuringExecution:
  - labelSelector:
      matchLabels: { app: web }
    topologyKey: kubernetes.io/hostname
  1. They always share one node
  2. No two land on the same node
  3. They only run on labelled nodes
  4. 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 ▸