title: Kubernetes Pod anti-affinity - evenly spread pods based on a label?
body: <p>We are finding that our Kubernetes cluster tends to have hot-spots where certain nodes get far more instances of our apps than other nodes.</p>
  <p>In this case, we are deploying lots of instances of Apache Airflow, and some nodes have 3x more web or scheduler components than others.</p>
  <p>Is it possible to use anti-affinity rules to force a more even spread of pods across the cluster?</p>
  <p><strong>E.g. &quot;prefer the node with the least pods of label <code>component=airflow-web</code>?&quot;</strong></p>
  <p>If anti-affinity does not work, are there other mechanisms we should be looking into as well?</p>