<p>We have a private kubernetes cluster running on a baremetal CoreOS cluster (with Flannel for network overlay) with private addresses.</p>

<p>On top of this cluster we run a kubernetes ReplicationController and Service for elasticsearch. To enable load-balancing, this service has a ClusterIP defined - which is also a private IP address: 10.99.44.10 (but in a different range to node IP addresses).</p>

<p>The issue that we face is that we wish to be able to connect to this ClusterIP from <em>outside</em> the cluster. As far as we can tell this private IP is not contactable from other machines in our private network...</p>

<p>How can we achieve this? </p>

<hr>

<p>The IP addresses of the nodes are:</p>

<pre><code> node 1  - 192.168.77.102
 node 2  - 192.168.77.103
</code></pre>

<p>.</p>

<p>and this is how the Service, RC and Pod appear with kubectl:</p>

<pre><code>NAME            LABELS          SELECTOR              IP(S)           PORT(S)
elasticsearch   &lt;none&gt;          app=elasticsearch     10.99.44.10     9200/TCP


CONTROLLER     CONTAINER(S)    IMAGE(S)       SELECTOR            REPLICAS
elasticsearch  elasticsearch   elasticsearch  app=elasticsearch   1


NAME                       READY     STATUS    RESTARTS   AGE
elasticsearch-swpy1         1/1       Running   0          26m
</code></pre>

<p>You need to set the <code>type</code> of your Service.</p>

<p><a href="http://docs.k8s.io/v1.0/user-guide/services.html#external-services" rel="nofollow">http://docs.k8s.io/v1.0/user-guide/services.html#external-services</a></p>

<p>If you are on bare metal, you don't have a LoadBalancer integrated.  You can use NodePort to get a port on each VM, and then set up whatever you use for load-balancing to aim at that port on any node.</p>
