<p>I am running a kubernetes cluster with 1 master (also a node) and 2 nodes on Azure. I am using Ubuntu with Flannel overlay network. So far everything is working well. The only problem I have is exposing the service to the internet.</p>

<p>I am running the cluster on an azure subnet. The master has a NIC attached to it that has a public IP. This means if I run a simple server that listens on port 80, I can reach my server using a domain name (Azure gives an option to have a domain name for a public IP).</p>

<p>I am also able to reach the kubernetes guest book frontend service with some hack. What I did was check all the listening ports on the master and try each port with the public IP. I was able to hit the kubernetes service and get response. Based on my understanding this is directly going to the pod that is running on the master (which is also a node) rather than going through the service IP (which would have load balanced across any of the pods).</p>

<p>My question is how do I map the external IP to the service IP? I know kubernetes has a setting that works only on GCE (which I can't use right now). But is there some neat way of telling etcd/flannel to do this?</p>

<p>If you use the <code>kubectl expose</code> command:</p>

<blockquote>
  <p>--external-ip="": External IP address to set for the service. The service can be accessed by this IP in addition to its generated service IP.</p>
</blockquote>

<p>Or if you create from a <code>json</code> or <code>yaml</code> file, use the <a href="https://kubernetes.io/docs/api-reference/v1.6/#servicespec-v1-core" rel="nofollow noreferrer"><code>spec/externalIPs</code></a> array.</p>
