Is there a way to limit the number os replicas per node in Kubernetes? I found some info about Spreading Constraints but didn't understand if this is possible.
Example: I want to have only 1 replica per node on the cluster.
I know that K8S automatically balances the replicas spreading across the nodes, but I want to enforce a specific limit in each node.
Is this possible?
The scheduler has many ways to just about everything but in the particular case of 1 replica per node you can use a required
mode anti-affinity.
If you want to ensure that all nodes have single replica on them you can use a DaemonSet.
You can create daemon set which makes sure every node in the cluster runs exactly one replica