confd don't pull automatically under supervisord

144 views
Skip to first unread message

H4Mm3r

unread,
Nov 25, 2015, 9:47:03 AM11/25/15
to confd-users
Hi all,

I'm trying to get haproxy+confd under inside a docker.

Many tutos are talking about :
https://beingasysadmin.wordpress.com/2015/09/07/scaling-ha-proxy-with-docker-confd-serf-etcd/
http://ox86.tumblr.com/post/90554410668/easy-scaling-with-docker-haproxy-and-confd

To get haproxy + confd in the same container, I'm using supervisord, here's my conf :

[program:haproxy]
command=/usr/local/sbin/haproxy -V -d -p /var/run/haproxy.pid -f /usr/local/etc/haproxy/haproxy.cfg
autorestart=true
priority=1

[program:confd]
command=/opt/confd/bin/confd -interval=10 -node 'http://192.168.1.242:4001'
autostart=true
autorestart=true

 (I tried with "-interval 10", and with 'interval = 10' in a confd.toml file)

Here's my haproxy.toml :

[template]
src = "haproxy.cfg.tmpl"
dest = "/usr/local/etc/haproxy/haproxy.cfg"
keys = [
  "/app/servers",
]
reload_cmd = "/usr/local/sbin/haproxy -f /usr/local/etc/haproxy/haproxy.cfg -p /var/run/haproxy.pid -sf $(pidof haproxy)"

Confd is properly starting, reading keys from my ectl backend, and reloading haproxy with all keys.

HAProxy is properly starting, I can see the HAProxy statistics page with all my http backends.

After that, no automatic pull of etcd backend... i cant have my new or deleted keys trigger confd to reload haproxy... and I dont understand why...

Is there anything I'm missing ? Any known issue ?

Thanks by advance.

H4Mm3r

Barry Flanagan

unread,
Nov 30, 2015, 12:18:16 PM11/30/15
to confd-users
Works fine here.

confd-haproxy.toml
---------------------------
src   = "haproxy.cfg.tmpl"
dest  = "/etc/haproxy/haproxy.cfg"
owner = "root"
group = "root"
mode  = "0644"
keys = [
  "/services",
  "/servers",
  ]
check_cmd  = "/usr/sbin/haproxy -c -f {{ .src }}"
reload_cmd = "/etc/init.d/haproxy reload"


supervisord cond config
----------------------------------
[program:confd]
command=confd -interval 30 -node 'http://XXX.XXX.XXX.XXX:4001'
numprocs=1
autostart=true
autorestart=true
priority=2

You might check /tmp/confd-stdout* and /tmp/confd-stderr* within your docker container which should contain information each time confd checks your templates.

Hope this helps.

-Barry Flanagan


Reply all
Reply to author
Forward
0 new messages