Expose Kubernete service to public inside mesosphere's DCOS Expose Kubernete service to public inside mesosphere's DCOS kubernetes kubernetes

Expose Kubernete service to public inside mesosphere's DCOS


Kubernetes on Mesos/DCOS does not support automatic LoadBalancer creation yet.

As the quick start states:

Through integration with some cloud providers (for example Google Compute Engine and AWS EC2), Kubernetes enables you to request that it provision a public IP address for your application.

AFAIK, only GCE, GKE, and AWS support automatic LoadBalancer creation so far.

Another key difference about DCOS (compared to kubernetes) is that it comes by default with two zones: public and private. So nothing scheduled on the private nodes is externally accessible without a reverse-proxy on the public nodes.

Additionally, Kubernetes on DCOS does not yet support IP-per-container. Support for IP-per-container is under development with the DCOS/Calico integration. Some community members have also reportedly attempted using cluster-wide docker overlay networking.

For now, there are a few alternative options for reaching your pod externally:

  1. Deploy your pod on all the public slaves (using resource role annotations) and hostPort:80. Then hit the address of the DCOS public slave AWS ELB.
  2. Create your own load balancer nginx pod (e.g. service-loadbalancer and schedule it on the public slaves with hostPort:80. Then hit the IP of the host node it's on.

It's definitely a priority of the Mesosphere Kubernetes Team to make this experience smoother on DCOS. Hopefully the solution will include automatic LoadBalancer creation.