How to create dynamic service (specific LB for example)?

Hi,

maybe you guys can help me, i’m trying to build a container service (in catalog pretty soon) that pull metadata from rancher to update it’s own configuration.
the idea is whenever i start (or stop) a container with specific labels, it will update my container services configurations .

any clues will be very helpful! :slight_smile:

Hi Xinity,

Not sure if it helps but i wrote a dynamic haproxy loadbalancer that queries labels to do dynamic loadbalancing, you could use that as an inspiration to get the info your looking at
https://hub.docker.com/r/nodeintegration/rancher-haproxy/

Specifically look at https://github.com/nodeintegration/rancher-haproxy/blob/master/gen-haproxy-map.py
This queries the rancher metadata service for containers that have a label to include into the loadbalancer

Cheers
Brendan

Hi Brendan,

Thanks for your reply! i’ll take a closer look at your repo, indeed that’s a way to achieve my goal :slight_smile:

i’ll see how i can “hack” to build my own service.

i’ll keep you in touch

Cheers,