如何在 OpenShift 上定义附加副本(pod)的位置(节点)?

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

我有 OpenShift 的主节点配置。我创建了一个应用程序。我在 node1 上有一个应用程序 运行 的 pod。现在我想创建一个额外的 pod(在 node2 上)。我知道您可以使用以下命令创建额外的 pods:

oc scale rc rcname --replicas=2

但是现在你的 kubernetes master 将决定你的新 pod 将在哪个节点上发生(最好的地方,所以也可能在 node1 上)。但是我想自己做这个决定(放在node2上)。 我知道您可以在创建容器时使用 --selector 来定义节点。

但我不知道你是否可以将其用于副本。

无法准确选择调度程序将复制控制器创建的下一个 pod 放置的位置。

您可以通过管理 schedulerConfigFile 内容来配置各种权重和调度相关性。看看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).