You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@mesos.apache.org by Gallagher Polyn <ga...@gmail.com> on 2015/01/22 18:52:09 UTC

can mesos-dns + mesos + docker emulate kubernetes' style of service discovery?

Hi,

My goal has been to develop multi-container docker applications locally and expect their seamless introduction to production environments (wow.)

I have done a POC for my goal with fig and Kubernetes, and I enjoy that I can depend on standard service ip/port environment variables to be present. (Similarly, I see that efforts resembling Jeff Lindsay’s approaches with docker + consul also rely on standard ip/port environment variables.)

Given the foregoing, can mesos-dns + mesos (possibly, mesosphere’s marathon) + docker be configured to emulate Kubernetes’ style of service discovery, i.e., no responsibility for DNS resolution in an application consuming other services via TCP?

Thanks,

Gallagher

Re: can mesos-dns + mesos + docker emulate kubernetes' style of service discovery?

Posted by mccraig mccraig <mc...@gmail.com>.
iirc i just used netstat from a dash script (in the docker container) to
get the gateway address, or used containers with --net=host, as appropriate

:c


On 24 Jan 2015, at 20:58, Gallagher Polyn <ga...@gmail.com> wrote:

On Thu, Jan 22, 2015 at 1:05 PM, craig mcmillan <mc...@gmail.com>
wrote:

> we use the HAProxy configurator script bundled with marathon to bind
> applications to ports :
>
> https://github.com/mesosphere/marathon/blob/master/bin/
> haproxy-marathon-bridge
>
> HAProxy runs on every mesos slave and each marathon app is then available
> on every slave at the port(s) declared in the marathon API on localhost (or
> the docker container gateway host)
>
> Given the foregoing, can mesos-dns + mesos (possibly, mesosphere’s
>> marathon) + docker be configured to emulate Kubernetes’ style of service
>> discovery, i.e., no responsibility for DNS resolution in an application
>> consuming other services via TCP?
>>
>
Craig, I now see at least advantage for mesos-dns in the context you
introduced in your comment: responsibilities for configuring a standard
docker container gateway host or handling the docker container gateway
host's resolution in client code can be replaced by mesos-dns. Maybe no big
deal, especially if you recommend an easy approach to making the docker
container gateway host visible.

G

Re: can mesos-dns + mesos + docker emulate kubernetes' style of service discovery?

Posted by Gallagher Polyn <ga...@gmail.com>.
On Thu, Jan 22, 2015 at 1:05 PM, craig mcmillan <mc...@gmail.com>
wrote:

> we use the HAProxy configurator script bundled with marathon to bind
> applications to ports :
>
> https://github.com/mesosphere/marathon/blob/master/bin/
> haproxy-marathon-bridge
>
> HAProxy runs on every mesos slave and each marathon app is then available
> on every slave at the port(s) declared in the marathon API on localhost (or
> the docker container gateway host)
>
> Given the foregoing, can mesos-dns + mesos (possibly, mesosphere’s
>> marathon) + docker be configured to emulate Kubernetes’ style of service
>> discovery, i.e., no responsibility for DNS resolution in an application
>> consuming other services via TCP?
>>
>
Craig, I now see at least advantage for mesos-dns in the context you
introduced in your comment: responsibilities for configuring a standard
docker container gateway host or handling the docker container gateway
host's resolution in client code can be replaced by mesos-dns. Maybe no big
deal, especially if you recommend an easy approach to making the docker
container gateway host visible.

G

Re: can mesos-dns + mesos + docker emulate kubernetes' style of service discovery?

Posted by Emilien Kenler <ek...@wizcorp.jp>.
Hello,

https://github.com/Wizcorp/frontrunner is another solution you can use to
configure your reverse proxy/load balancer.
Instead of using a cronjob, the configuration will be updated when
something changes in ZooKeeper.



On Fri, Jan 23, 2015 at 4:32 AM, Gallagher Polyn <ga...@gmail.com>
wrote:

> we use the HAProxy configurator script bundled with marathon to bind
>> applications to ports :
>>
>> https://github.com/mesosphere/marathon/blob/master/bin/
>> haproxy-marathon-bridge
>>
>
>
>> Given the foregoing, can mesos-dns + mesos (possibly, mesosphere’s
>>> marathon) + docker be configured to emulate Kubernetes’ style of service
>>> discovery, i.e., no responsibility for DNS resolution in an application
>>> consuming other services via TCP?
>>>
>>
> Thanks Craig. I will try that approach, which I see documented here:
> mesosphere.com/docs/getting-started/service-discovery.
>
> In light of your response, and direction to an approach that predates
> mesos-dns, it will need to consider what, if any, part mesos-dns has for my
> goal.
>
> Directly, it was
> progrium.com/blog/2014/09/10/automatic-docker-service-announcement-with-registrator
> and
> philzim.com/2014/11/12/service-discovery-orchestration-with-mesos-and-consul
> that set my expectation that consul could now be replaced with mesos-dns in
> mesos/marathon clusters.
>
> G
>
>


-- 
<http://www.wizcorp.jp/>Emilien Kenler
Server Engineer | Wizcorp Inc. <http://www.wizcorp.jp/>
------------------------------
TECH . GAMING . OPEN-SOURCE WIZARDS+ 81 (0)3-4550-1448|Website
<http://www.wizcorp.jp/>|Twitter <https://twitter.com/Wizcorp>|Facebook
<http://www.facebook.com/Wizcorp>|LinkedIn
<http://www.linkedin.com/company/wizcorp>

Re: can mesos-dns + mesos + docker emulate kubernetes' style of service discovery?

Posted by Gallagher Polyn <ga...@gmail.com>.
>
> we use the HAProxy configurator script bundled with marathon to bind
> applications to ports :
>
> https://github.com/mesosphere/marathon/blob/master/bin/
> haproxy-marathon-bridge
>


> Given the foregoing, can mesos-dns + mesos (possibly, mesosphere’s
>> marathon) + docker be configured to emulate Kubernetes’ style of service
>> discovery, i.e., no responsibility for DNS resolution in an application
>> consuming other services via TCP?
>>
>
Thanks Craig. I will try that approach, which I see documented here:
mesosphere.com/docs/getting-started/service-discovery.

In light of your response, and direction to an approach that predates
mesos-dns, it will need to consider what, if any, part mesos-dns has for my
goal.

Directly, it was
progrium.com/blog/2014/09/10/automatic-docker-service-announcement-with-registrator
and
philzim.com/2014/11/12/service-discovery-orchestration-with-mesos-and-consul
that set my expectation that consul could now be replaced with mesos-dns in
mesos/marathon clusters.

G

Re: can mesos-dns + mesos + docker emulate kubernetes' style of service discovery?

Posted by craig mcmillan <mc...@gmail.com>.
we use the HAProxy configurator script bundled with marathon to bind 
applications to ports :

https://github.com/mesosphere/marathon/blob/master/bin/haproxy-marathon-bridge

HAProxy runs on every mesos slave and each marathon app is then 
available on every slave at the port(s) declared in the marathon API on 
localhost (or the docker container gateway host)

this is working fine for the short-lived connections of multi-layer HTTP 
apps, and also long-lived TCP connections between logstash-forwarder and 
logstash

:craig

On 22 Jan 2015, at 17:52, Gallagher Polyn wrote:

> Hi,
>
> My goal has been to develop multi-container docker applications 
> locally and expect their seamless introduction to production 
> environments (wow.)
>
> I have done a POC for my goal with fig and Kubernetes, and I enjoy 
> that I can depend on standard service ip/port environment variables to 
> be present. (Similarly, I see that efforts resembling Jeff Lindsay’s 
> approaches with docker + consul also rely on standard ip/port 
> environment variables.)
>
> Given the foregoing, can mesos-dns + mesos (possibly, mesosphere’s 
> marathon) + docker be configured to emulate Kubernetes’ style of 
> service discovery, i.e., no responsibility for DNS resolution in an 
> application consuming other services via TCP?
>
> Thanks,
>
> Gallagher