[Container-tools] my next docker-balancer

Muayyad AlSadi alsadi at gmail.com
Tue Sep 1 17:07:03 UTC 2015


I've published the new one

https://github.com/muayyad-alsadi/docker-glue



On Fri, Aug 28, 2015 at 3:52 PM, Muayyad AlSadi <alsadi at gmail.com> wrote:

> hi,
>
> inspired by /usr/bin/atomic usage of container labels <
> http://www.projectatomic.io/docs/usr-bin-atomic/
>
> I wrote a simple python script <
> https://github.com/muayyad-alsadi/docker-balancer
>
> that reconfigure haproxy to route http requests based on host to
> containers having the corresponding labels (or env variable) and
> load-balancer them
>
> docker run -d -name my_wp_1 -l container_host=wordpress.example.com
> wordpress
> docker run -d -name my_wp_2 -l container_host=wordpress.example.com
> wordpress
> docker run -d -name my_wp2 -e container_host=wordpress2.example.com
> wordpress
>
> I actually have a systemd service mycontainer at .service (as in
> mycontainer at myapp_1 where I strip _number to allow launching multiple
> containers for the same app) which I use to run and pass those labels from
> /etc/sysconfig/mycontainer/myapp.rc
>
> I'm planning to extend the functionality of this script (called
> docker-glue) to support any http port
>
> docker run -d -name wp1 -l glue_http_80_host=wordpress.example.com
> wordpress
> docker run -d -name wp1 -l glue_http_80_host=openstack.example.com -l
> glue_http_80_prefix='dashboard/' horizon
> docker run -d -name wp1 -l glue_http_80_host=openstack.example.com -l
> glue_http_80_prefix='identity/' keystone
>
> most likely I'll strip the prefix unless glue_http_80_strip_prefix=0 is
> passed
>
> I believe this will help in openstack kolla and many other projects.
>
> my docker glue has a modular plugins to do various things (ex. attach
> docker to openvswitch or publish docker inspect to etcd ..etc.)
>
> I would like to hear suggestions from you
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/container-tools/attachments/20150901/c90676da/attachment.htm>


More information about the Container-tools mailing list