From d44aac61ee535fdd938d693d9263a4fa87189fa1 Mon Sep 17 00:00:00 2001 From: Yann Cezard Date: Thu, 3 Mar 2016 17:50:00 +0100 Subject: [PATCH 1/4] Using exec to launch consul-template, in order to take PID 1. --- launch.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/launch.sh b/launch.sh index 2ad3db0..8767990 100755 --- a/launch.sh +++ b/launch.sh @@ -77,7 +77,7 @@ function launch_haproxy { # be started) [ -f /haproxy/haproxy.cfg ] && rm /haproxy/haproxy.cfg - ${CONSUL_TEMPLATE} -config ${CONSUL_CONFIG} \ + exec ${CONSUL_TEMPLATE} -config ${CONSUL_CONFIG} \ -log-level ${CONSUL_LOGLEVEL} \ -wait ${CONSUL_MINWAIT}:${CONSUL_MAXWAIT} \ -consul ${CONSUL_CONNECT} ${ctargs} ${vars} From 281d30082f647033e4d76a0c2cc054ac6b2945b2 Mon Sep 17 00:00:00 2001 From: robvalk Date: Wed, 6 Apr 2016 15:51:57 +1000 Subject: [PATCH 2/4] Update consule template to version 0.14.0 To address https://github.com/hashicorp/consul-template/issues/442 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 78b743b..6be7df4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM alpine:3.3 MAINTAINER Steven Borrelli -ENV CONSUL_TEMPLATE_VERSION=0.12.2 +ENV CONSUL_TEMPLATE_VERSION=0.14.0 RUN apk update && \ apk add bash haproxy ca-certificates zip && \ From a84d44d08d47ad5f907a057e30c4dc4023063a65 Mon Sep 17 00:00:00 2001 From: robvalk Date: Thu, 7 Apr 2016 16:53:18 +1000 Subject: [PATCH 3/4] Use hrd_dom() to ignore port number in Host header --- template/consul.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/consul.tmpl b/template/consul.tmpl index ccc53f0..a851d85 100644 --- a/template/consul.tmpl +++ b/template/consul.tmpl @@ -30,7 +30,7 @@ frontend www # Generated automatically by consul-template {{ range services }} - acl host_{{ .Name }} hdr(host) -i {{ .Name }}.{{ or (env "HAPROXY_DOMAIN") "haproxy.service.consul" }} + acl host_{{ .Name }} hdr_dom(host) -i {{ .Name }}.{{ or (env "HAPROXY_DOMAIN") "haproxy.service.consul" }} use_backend {{ .Name }}_backend if host_{{ .Name }} {{ end }} From 60ed46fb7a82bde0ec00f263b8d356471ab5a6c6 Mon Sep 17 00:00:00 2001 From: robvalk Date: Thu, 7 Apr 2016 17:01:16 +1000 Subject: [PATCH 4/4] Use hrd_beg() to ignore port number in Host header --- template/consul.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/consul.tmpl b/template/consul.tmpl index a851d85..6eec8c3 100644 --- a/template/consul.tmpl +++ b/template/consul.tmpl @@ -30,7 +30,7 @@ frontend www # Generated automatically by consul-template {{ range services }} - acl host_{{ .Name }} hdr_dom(host) -i {{ .Name }}.{{ or (env "HAPROXY_DOMAIN") "haproxy.service.consul" }} + acl host_{{ .Name }} hdr_beg(host) -i {{ .Name }}.{{ or (env "HAPROXY_DOMAIN") "haproxy.service.consul" }} use_backend {{ .Name }}_backend if host_{{ .Name }} {{ end }}