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

**URL:** <https://forums.suse.com/t/how-to-create-dynamic-service-specific-lb-for-example/4233>\
**Category:** General\
**Created:** [October 8, 2016, 5:18pm UTC](https://forums.suse.com/t/how-to-create-dynamic-service-specific-lb-for-example/4233 "2016-10-08T17:18:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![xinity](https://avatars.discourse-cdn.com/v4/letter/x/7cd45c/32.png) [@xinity](https://forums.suse.com/u/xinity)\
**Post date:** [October 8, 2016, 5:18pm UTC](https://forums.suse.com/t/how-to-create-dynamic-service-specific-lb-for-example/4233/1 "2016-10-08T17:18:49Z")

</div>

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! 🙂

---

<div class="post-metadata">

**Author:** ![mrproper](https://avatars.discourse-cdn.com/v4/letter/m/c89c15/32.png) [@mrproper](https://forums.suse.com/u/mrproper)\
**Post date:** [October 11, 2016, 10:03pm UTC](https://forums.suse.com/t/how-to-create-dynamic-service-specific-lb-for-example/4233/2 "2016-10-11T22:03:38Z")

</div>

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/](https://hub.docker.com/r/nodeintegration/rancher-haproxy/)

Specifically look at [https://github.com/nodeintegration/rancher-haproxy/blob/master/gen-haproxy-map.py](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

---

<div class="post-metadata">

**Author:** ![xinity](https://avatars.discourse-cdn.com/v4/letter/x/7cd45c/32.png) [@xinity](https://forums.suse.com/u/xinity)\
**Post date:** [October 12, 2016, 6:11am UTC](https://forums.suse.com/t/how-to-create-dynamic-service-specific-lb-for-example/4233/3 "2016-10-12T06:11:26Z")

</div>

Hi Brendan,

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

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

i’ll keep you in touch

Cheers,
