I am running a large world spanning openshift cluster. When I run a build from a BuildConfig it will randomly assign the build to any node in the entire cluster. This is problematic as many regions have higher latency which dramatically slows down build times and image uploads. I can't find any information in the documentation on using node selector tags at this level. I have tried adding openshift.io/node-selector: dc=mex01 to the annotations as it is done with project level node-selectors to no avail. Any help would be great. Thanks!
Asked
Active
Viewed 1,801 times
2
-
Project node selectors should apply to build pods - please open an issue at https://github.com/openshift/origin/issues/new so we can debug – Clayton May 04 '16 at 23:35
-
I just wanted to check that project node selectors were the only way and that seems to be the case. Thanks! – Timothy Allen May 17 '16 at 16:01
-
This question is a duplicate of http://stackoverflow.com/questions/36511443/running-builds-on-a-specific-dedicated-node-set :) – Danielle Madeley Oct 24 '16 at 00:00
3 Answers
0
Project node selectors are the only way to control where builds happen at the present time.

Timothy Allen
- 21
- 3
-
This is now possible on Build Configs since Origin 1.3: https://docs.openshift.org/latest/dev_guide/builds.html#dev-guide-assigning-builds-to-nodes – Lionel Orellana Dec 13 '16 at 06:15
0
Since this is the Question that shows up first on Google:
This is now possible (since 1.3 apparently): https://docs.openshift.org/latest/dev_guide/builds/advanced_build_operations.html#dev-guide-assigning-builds-to-nodes

mhutter
- 2,800
- 22
- 30
0
To elaborate a bit on mhutter's answer, here are example yaml fragments using node selectors:
a BuildConfig:
apiVersion: "v1"
kind: "BuildConfig"
metadata:
name: "sample-build"
spec:
nodeSelector:
canbuild: yes
and a Node:
apiVersion: v1
kind: Node
metadata:
creationTimestamp: null
labels:
beta.kubernetes.io/arch: amd64
beta.kubernetes.io/os: linux
kubernetes.io/hostname: mybestnodeever
canbuild: yes
Since OCPv3.6 there are the taints and tolerations, which can be applied to nodes and pods, but I haven't yet found any docs on applying tolerations to the build configs (or on whether they propagate to the builder pods). https://docs.openshift.com/container-

ptrk
- 1,800
- 1
- 15
- 24