<p>How to allow only one pod of a type on a node in Kubernetes. Daemon-sets doesn't fit into this use-case.</p>

<p>For e.g. - Restricting scheduling of only one Elasticsearch pod on a node, to prevent data loss in case the node goes down.</p>

<p>It can be achieved by carefully planning CPU/memory resource of pod and machine type of cluster.</p>

<p>Is there any other way to do so?</p>

<p>Kubernetes 1.4 introduced <code>Inter-pod affinity and anti-affinity</code>. From the <a href="https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#inter-pod-affinity-and-anti-affinity-beta-feature" rel="noreferrer">documentation</a>: <code>Inter-pod affinity and anti-affinity allow you to constrain which nodes your pod is eligible to schedule on based on labels on pods that are already running on the node</code>.</p>

<p>That won't prevent a pod to be scheduled on a node, but at least the pod will be scheduled on the node if and only if the scheduler has no choice.</p>
