Reputation: 889
Is there a way to configure an RC such that i have a single replica on each of my worker nodes?
I just created a x2 replica RC for elasticsearch and it has placed both instances onto just one of my worker nodes. I would prefer to have one instance on each of my worker nodes.
This is particularity important for an application like elasticsearch that would use persistent storage on the docker host - having two elasticsearch instances using the same datastore would likely cause issues.
How is this possible to achieve?
Environment:
1x Kubernetes master - physical server running CoreOS
2x Kubernetes nodes - physical servers running CoreOS
Upvotes: 0
Views: 889
Reputation: 18111
You can't choose nodes directly for pods created by scaling up a replication controller. The scheduler assigns nodes based on constraints. You can artificially prevent pods from going to the same node by making them use a resource a node only has one of, like a hostPort.
The daemon controller proposal (https://github.com/kubernetes/kubernetes/pull/13368) sounds more like what you want, which would let you spread pods across nodes
Upvotes: 3