<p>I've setup a kubernetes cluster using <a href="https://github.com/kubernetes-incubator/kubespray" rel="nofollow noreferrer">kubespray</a>, and now I am trying to follow <a href="http://%20https://blog.heptio.com/how-to-deploy-web-applications-on-kubernetes-with-heptio-contour-and-lets-encrypt-d58efbad9f56" rel="nofollow noreferrer">this guide</a></p>

<pre><code>root@node1 ~ # kubectl get -n heptio-contour service contour -o wide
NAME      TYPE           CLUSTER-IP     EXTERNAL-IP   PORT(S)                      AGE       SELECTOR
contour   LoadBalancer   10.233.55.94   &lt;pending&gt;     80:32414/TCP,443:30149/TCP   42m       app=contour
</code></pre>

<p>It seems <code>EXTERNAL-IP</code> is pending because I am on a bare metal machine (not AWS/GKE etc.)</p>

<p>What do I need to do in order to get an external ip showing there?</p>

<p><a href="https://kubernetes.io" rel="noreferrer">Kubernetes</a> offers three ways to expose a service:</p>

<p>1) <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/internal-load-balancing" rel="noreferrer">L4 LoadBalancer</a>: Available only on cloud providers such as GCE and AWS</p>

<p>2) Expose Service via NodePort: <a href="https://kubernetes.io/docs/concepts/services-networking/service/" rel="noreferrer">The NodePort</a> directive allocates a port on every worker node, which proxy the traffic to the respective Pod.</p>

<p>3) L7 Ingress: <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/" rel="noreferrer">The Ingress</a> is a dedicated load balancer (eg. nginx, HAProxy, traefik, vulcand) that redirects incoming HTTP/HTTPS traffic to the respective endpoints</p>

<p>Kubernetes does not offer implementation of network load-balancers (Services of type LoadBalancer) for bare metal clusters.</p>

<p>If you’re not running Kubernetes cluster on a supported IaaS platform (GCP, AWS, Azure…), LoadBalancers will remain in the “pending” state regardless of the time they were created.</p>

<p>The reason is the lack of support of IP routing between the external world and Kubernetes; there is no default implementation of transferring dns zones 
used by Ingress to allocate communication to internal of the cluster.</p>

<p>There are external projects to provide bare-metal even in federation clusters mode to be part of standalone or hybrid solution.</p>

<p>It depends on the scale and the maturity of projects you have, so it should begin with choosing a proper load balancer or <a href="https://en.wikipedia.org/wiki/Virtual_IP_address" rel="noreferrer">VIP</a> provider:</p>

<p><a href="https://github.com/google/metallb" rel="noreferrer">https://github.com/google/metallb</a></p>

<p><a href="https://docs.traefik.io/" rel="noreferrer">https://docs.traefik.io/</a></p>

<p><a href="https://github.com/kubernetes/contrib/tree/master/keepalived-vip" rel="noreferrer">https://github.com/kubernetes/contrib/tree/master/keepalived-vip</a></p>

<p><a href="http://vulcand.github.io/" rel="noreferrer">http://vulcand.github.io/</a></p>

<p>and deprecated:</p>

<p><a href="http://www.linuxvirtualserver.org/software/ipvs.html" rel="noreferrer">http://www.linuxvirtualserver.org/software/ipvs.html</a></p>

<p>Please notice that in federation clusters (more than one bare metal Kubernetes
cluster) is needed to export IP address of each physical machine to central API
provider and probably it is not covered by the links I provided to you.</p>
