Search code examples
replicationscalingopenshift-origin

How to define the place (node) of an additional replica (pod) on OpenShift?


I have a master-node configuration of OpenShift. I have created an application. I have a pod of the app running on node1. Now I want to create an additional pod (on node2). I know you can create additional pods with the following command:

oc scale rc rcname --replicas=2

But now your kubernetes master will decide on which node your new pod will take place (the best place, so maybe also on node1). But I want to make this decision by myself (place it on node2). I know you can use a --selector for defining your node when you're creating a container.

But I don't know if you can use this for replicas.


Solution

  • There isn't a way to choose exactly where the scheduler will place the next pod that your replication controller creates.

    You can configure various weights and scheduling affinities by managing the schedulerConfigFile contents. Take a look at https://docs.openshift.com/enterprise/3.0/admin_guide/scheduler.html for the different options. You set the location of your scheduler config in the master-config.yaml (https://docs.openshift.com/enterprise/3.0/admin_guide/master_node_configuration.html).