How to pass nodeSelector for deployment config
Hi,
I'm playing a bit with OpenShift - testing it really and let's say I want to configure node independency within the same cluster in a way that live pods are hosted on live nodes, test pods can share live nodes (if resources allow) based on the label. It's not the live example etc, I'm testing on my own VMs at the moment some use cases.
So let's say in the 'potential' cluster I could have 10 nodes whereas 4 out of 10 would have a label 'environment=test'. What I want is to configure deployment and build config that all the builds and pod placements for the desired project will only be deployed to the nodes with label 'environment=test'. Is this achievable at all? I only found solution to configure builds to happen on selected node and deployment for pod to happen by specifying a node hostname so not really something I need.
Thanks!
Responses
Also see the following link on how to do this multiple ways. How to force a pod to schedule to a specific node in OpenShift Container Platform
@jgrzabel - I think I need to better explain this in the Knowledge Solution. It outlines using nodeSelector and in the example the nodeSelector is pointing to a label specific to only one node. It is possible to use a nodeSelector that references a label that is tied to a group of nodes.
apiVersion: v1
kind: DeploymentConfig
template:
spec:
nodeSelector: ### ADD
environment: testing ### ADD
How to force a pod to schedule to a specific node using nodeSelector in OCP
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
