Public Repository

Last pushed: a year ago
Short Description
This container is running haproxy and consul-template. Refreshed by Consul
Full Description
  1. Create your consul template file: /etc/htemplate/template.ctmpl
  2. Run as:
    docker run -d -p 80:80 -v /etc/htemplate/template.ctmpl:/etc/htemplate/template.ctmpl rabotond/haproxy-consultemplate:3.0 [consul host ip address]

It will query your consul agent at the IP you give, and then reloads haproxy config every time when there is a change in Consul. You should edit your template file to match, the service in consul and also the port on which you backend is listening.

Github files:

Template example:

  maxconn 2048
  log local1 notice
  log global
  timeout connect 5000
  timeout client  36000000
  timeout server  36000000
frontend http-frontend
  default_backend endpoint
backend endpoint
  balance roundrobin
  mode http{{range service "da_cluster"}}
  server {{.Node}} {{.Address}}:8080{{end}}
Docker Pull Command