Something that has come up when using OpenShift and that was tricky enough to be shared on a blog post.
On OpenShift you have this routers and registry which by default are on the master nodes and that’s fine. Things get tricky if you don’t want anything else in there.
I finally figured this out after digging in some internal mailing lists and this is actually not too difficult. The key thing is to have this on the ‘default’ namespace annotations :
The default namespace is an internal namespace used for openshift infrastructure services.
Let me describe this a little bit further, here is my node labels configuration :
I had already a router running fine on my master by forcing (this was generated by the oadm router command) it with a nodeSelector on the deploymentConfig :
Now I am going to edit my /etc/origin/master/master-config.yaml and add :
which force all new nodes to get on the primary region.
As expected if I delete my router and redeploy it :
The router was not able to be deployed since getting since we explicitely told the scheduler that we want pods only on infra :
So what I had to do now is to edit the default namespace (not project but namespace that’s a critical point) and add in the metadata/annotations section :
which to say that the default project can be indeed deployed on region=infra.
Now let’s try again :
and check the log :
which seems to work fine and deployed on infra :