Can the replication be on different node types?

11/28/2018

I'm a newbie to Kubernetes, but I'm confused about one thing:

Let's say I've set a pod's replication to 100.

Is it possible to assign a portion of that 100, eg 80, to one node-type, specfically PREEMPTIBLE nodes, and the remaining 20 to another node-type, eg NON-preemtimble nodes?

If that's NOT possible, then is the "correct" way to achieve this is to have 2 pods and each one is set to a different node type? But then, can the containers within the pods from one node type (eg PREemptible nodes) still communicate just as easily (ie just by using hostname?) with the containers on other pods on the other node type (eg NON-preemtible nodes)?

-- Jonathan Sylvester
google-kubernetes-engine

1 Answer

11/28/2018

You can setup Node Affinity on the pods.This will help distribute the pods between the nodes. It might not distribute exactly 80/20 (using the example given); however, the Scheduler will take into consideration the weight of the nodes. In this case, the node types do not matter. You can read more about Node Affinity here.

-- Jason
Source: StackOverflow