<p>I have some stateless applications where I want one pod to be scheduled on each node (limited by a node selector). If I have 3 nodes in the cluster and one goes down then I should still have 2 pods (one on each node).</p>

<p>This is exactly what DaemonSets do, but DaemonSets have a couple of caveats to their usage (such as not supporting node draining, and tools such as Telepresence not supporting them). So I would like to emulate the behaviour of DaemonSets using Deployments.</p>

<p>My first idea was to use horizontal pod autoscaler with custom metrics, so the desired replicas would be equal to the number of nodes. But even after implementing this, it still wouldn't guarantee that one pod would be scheduled per node (I think?).</p>

<p>Any ideas on how to implement this?</p>

bcoughlan
<p>You can consider the below combination</p>

<ol>
<li>HPA to update the replicas to number of nodes based on custom metrics. I think you have already done this</li>
<li>Use node Affinity and AntiAffinity to run only one pod on each node</li>
</ol>
