In your pod or buildconfig yaml you can specify which nodes the pod should run on, generally by specifying one or more of the labels assigned to the appropriate nodes. For instance {"zone":"east"}.

Sometimes you want to be more specific and have a pod run on a very specific host. To find out which labels are available for the nodes, run the following command:

$ oc get nodes --show-labels

Example output:

NAME                    STATUS                     AGE       VERSION             LABELS
infra-0    Ready                      48d       v1.7.6+a08f5eeb62,,,,,,logging-infra-fluentd=true,logging=true,region=infra,type=infra,zone=default
infra-1    Ready                      48d       v1.7.6+a08f5eeb62,,,,,,logging-infra-fluentd=true,logging=true,region=infra,type=infra,zone=default
master-0   Ready,SchedulingDisabled   48d       v1.7.6+a08f5eeb62,,,,,,logging-infra-fluentd=true,logging=true,openshift-infra=apiserver,type=master,zone=default
master-1   Ready,SchedulingDisabled   48d       v1.7.6+a08f5eeb62,,,,,,logging-infra-fluentd=true,logging=true,type=master,zone=default
master-2   Ready,SchedulingDisabled   48d       v1.7.6+a08f5eeb62,,,,,,logging-infra-fluentd=true,logging=true,type=master,zone=default
node-0     Ready                      48d       v1.7.6+a08f5eeb62,,,,,,logging-infra-fluentd=true,logging=true,type=app,zone=default
node-1     Ready                      48d       v1.7.6+a08f5eeb62,,,,,,logging-infra-fluentd=true,logging=true,type=app,zone=default
node-2     Ready                      48d       v1.7.6+a08f5eeb62,,,,,,logging-infra-fluentd=true,logging=true,type=app,zone=default

From this you will see that each node has a label. You can use this in your annotations for the pod of buildconfig.

kind: DeploymentConfig
      nodeSelector: node-0

Leave a Reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.