rabotond/haproxy-consultemplate

By rabotond

Updated about 9 years ago

This container is running haproxy and consul-template. Refreshed by Consul

Image
0

1.2K

rabotond/haproxy-consultemplate repository overview

  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: https://github.com/rabotond/micado_docker/tree/master/haproxy-consulemplate

Template example:

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

Tag summary

Content type

Image

Digest

Size

60.8 MB

Last updated

about 9 years ago

docker pull rabotond/haproxy-consultemplate