Easily test your OpenShift applications exposed by the router

OpenShift integrate[1] a router based on HAproxy to expose your services to the outside world. Whenever your do a :

oc expose servicename

it would expose by default the servicename this URL :

servicenameprojectname.defaultSubDomain

The defaultSubdomain is usually a wildcard DNS record that you have configured in your domain server by your system administrator. 

Now for your openshift testing if you don’t want to ask your system administrator to configure a new CNAME going to your testing environement you can just use the free service xp.io

The XP.IO service is a special DNS service which would take a an IP address and xp.io and report back the IP of this IP address to itself and to all subdomain so that the IP:

blah.1.2.3.4.xp.io

will go to 1.2.3.4 same goes for foo.1.2.3.4, bar.1.2.3.4 etc…

You just then need to configure it in OpenShift by editing the value (assuming 1.2.3.4 is your public IP which come back to your router) :


routingConfig:
    subdomain: "1.2.3.4.xip.io"

Or if you use the openshift-ansible scripts to add this your /etc/ansible/hosts

osm_default_subdomain=1.2.3.4.xip.io

and then you get all your route exposed properly without bother your always busy system admin.

[1] Which lately got merged into kubernetes as the “ingress” feature

Share on FacebookTweet about this on TwitterShare on Google+Print this pageEmail this to someone
  • Srinivas Kotaru

    Good, keep writing admin side of openshift articles