amazon-web-services - Expose Kubernete service to public inside mesosphere's DCOS - answerstu - answerstu

Expose Kubernete service to public inside mesosphere's DCOS

Followed I created a DCOS cluster on Amazon AWS. Then I followed and installed Kubernete on it. Then I followed I was able to launch pods successfully. Then I ran into problem with expose the service to public.

$ dcos kubectl expose rc my-nginx --port=80 --type=LoadBalancer
service "my-nginx" exposed
$ dcos ssun$ dcos kubectl get svc my-nginx
my-nginx                 80/TCP    run=my-nginx   8s

The EXTERNAL_IP address does not exists. According to the tutorial, it should. So I'm thinking it has something to do with the fact that my Kubernete is inside DCOS.

Please help. Thank you very much!

1 Answer

  1. Marcus- Reply


    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.

Leave a Reply

Your email address will not be published. Required fields are marked *

You can use these HTML tags and attributes <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>