<p>I am running openshift in aws</p>

<pre><code>[centos@ip-10-0-0-14 ~]$ oc version
oc v3.6.1+008f2d5
kubernetes v1.6.1+5115d708d7
features: Basic-Auth GSSAPI Kerberos SPNEGO

Server https://ip-10-0-0-14.ec2.internal:8443
openshift v3.6.1+008f2d5
kubernetes v1.6.1+5115d708d7
</code></pre>

<p>I have one master and two nodes.
How can I expose a service to aws public ip? I can access service internally:</p>

<pre><code>links http://blogroute-project-a.router.default.svc.cluster.local
</code></pre>

<p>How can I expose it to public ip? Is it possible to be done in openshfit web console?
I have tried to follow <a href="https://docs.openshift.com/container-platform/3.4/dev_guide/expose_service/expose_internal_ip_service.html" rel="nofollow noreferrer">https://docs.openshift.com/container-platform/3.4/dev_guide/expose_service/expose_internal_ip_service.html</a> but failed.</p>

<p>In command:</p>

<p>oc patch svc blog -p '{"spec":{"externalIPs":["what ip?"]}}' </p>

<p>doc states about ip visible in ifconfig, (but it's not aws public ip).
Which ip should I use, aws public ip, or private ip (eg 10-0-0-14) from aws local network?</p>

<p>Should I use ip of master node? Or of worker? If I have two worker nodes shoudl I write ips of both of them?</p>

<p>Currently there are following routes:</p>

<pre><code>[centos@ip-10-0-0-14 ~]$ oc get routes
NAME             HOST/PORT                                                   PATH      SERVICES         PORT       TERMINATION   WILDCARD
blog             blog-project-a.router.default.svc.cluster.local                       blog             8080-tcp                 None
blog-django-py   blog-django-py-project-a.router.default.svc.cluster.local             blog-django-py   8080-tcp                 None
blog2            ec2-3-90-171-97.compute-1.amazonaws.com                     /blog2    blog             8080-tcp                 None
blogroute        blogroute-project-a.router.default.svc.cluster.local                  blog             8080-tcp                 None
</code></pre>

<p>for following services:</p>

<pre><code>[centos@ip-10-0-0-14 ~]$ oc get svc
NAME             CLUSTER-IP      EXTERNAL-IP   PORT(S)    AGE
blog             172.30.111.64   3.90.171.97   8080/TCP   5d
blog-django-py   172.30.184.15   &lt;none&gt;        8080/TCP   5d
</code></pre>

bastiat
<p>You can do this by creating a load balancer with public IP and pointing it to all nodes at port 80 (haproxy is listening on port 80). Then you have to create a wildcard DNS, something like <code>*.apps.yourdomain.com</code>, and point that to the load balancer you created.</p>

<p>Afterwards you must configure your domain in the OpenShift cluster, see <a href="https://docs.openshift.com/container-platform/3.6/install_config/install/advanced_install.html#configuring-cluster-variables" rel="nofollow noreferrer">https://docs.openshift.com/container-platform/3.6/install_config/install/advanced_install.html#configuring-cluster-variables</a>.</p>

<p>Then you can expose your service and create a route, for example <code>blog.apps.yourdomain.com</code>.</p>
