Skip to content

Commit

Permalink
Merge pull request #249 from sielaq/master
Browse files Browse the repository at this point in the history
Update
  • Loading branch information
sielaq authored Jan 27, 2017
2 parents 551ac7e + f7ce5a3 commit fec11dc
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![Build Status](https://travis-ci.org/eBayClassifiedsGroup/PanteraS.svg?branch=master)](https://travis-ci.org/eBayClassifiedsGroup/PanteraS)
[![Docker Hub](https://img.shields.io/badge/docker-ready-blue.svg)](https://hub.docker.com/r/panteras/paas-in-a-box/)
[![Current Release](http://img.shields.io/badge/release-0.3.3-blue.svg)](https://github.com/eBayClassifiedsGroup/PanteraS/releases/tag/v0.3.3)
[![Current Release](http://img.shields.io/badge/release-0.3.4-blue.svg)](https://github.com/eBayClassifiedsGroup/PanteraS/releases/tag/v0.3.4)

# PanteraS <br> _entire_ Platform as a Service, in a box
_"One container to rule them all"_
Expand Down Expand Up @@ -73,7 +73,7 @@ Depending on `MASTER` and `SLAVE` you can define role of the container
## Usage:
Clone it
```
git clone -b 0.3.2 https://github.com/eBayClassifiedsGroup/PanteraS.git
git clone -b 0.3.4 https://github.com/eBayClassifiedsGroup/PanteraS.git
cd PanteraS
```
#### Default: Stand alone mode
Expand Down
1 change: 1 addition & 0 deletions generate_yml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ CONSUL_PARAMS="agent \
#
CONSUL_TEMPLATE_PARAMS="-consul=${CONSUL_IP}:8500 \
-template haproxy.cfg.ctmpl:/etc/haproxy/haproxy.cfg:/opt/consul-template/haproxy_reload.sh \
-consul-retry \
-max-stale=0 \
${KEEPALIVED_CONSUL_TEMPLATE}"
#
Expand Down
8 changes: 4 additions & 4 deletions infrastructure/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ RUN apt-get update \

ENV SUPERVISORD_APP_VERSION 3.2.3
ENV DOCKER_APP_VERSION 1.12.6-0~ubuntu-xenial
ENV CONSUL_APP_VERSION 0.7.2
ENV CONSUL_TEMPLATE_APP_VERSION 0.16.0
ENV CONSUL_APP_VERSION 0.7.3
ENV CONSUL_TEMPLATE_APP_VERSION 0.18.0
ENV HAPROXY_APP_VERSION 1.6.11-1ppa1~xenial
ENV MESOS_APP_VERSION 1.0.1-2.0.94.ubuntu1604
ENV MARATHON_APP_VERSION 1.3.6-1.0.540.ubuntu1604
ENV MARATHON_APP_VERSION 1.3.8-1.0.566.ubuntu1604
ENV REGISTRATOR_APP_VERSION v7
ENV CHRONOS_APP_VERSION 2.4.0-0.1.20151007110204.ubuntu1404
ENV FABIO_APP_VERSION 1.3.6
ENV FABIO_APP_VERSION 1.3.7
ENV FABIO_GO_APP_VERSION go1.7.4

ENV DOCKER_HOST unix:///tmp/docker.sock
Expand Down
41 changes: 41 additions & 0 deletions infrastructure/haproxy.cfg.ctmpl.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{{file "haproxy.cfg"}}

{{range services}}{{if .Tags | contains "haproxy"}}{{$name := .Name}} # HTTP service: {{.Name}}
{{if eq (env "CONSUL_DOMAIN") ""}}acl acl_{{$name}} hdr(host) -i {{$name}}.service.consul{{else}}acl acl_{{$name}} hdr(host) -i {{$name}}.service.{{env "CONSUL_DOMAIN"}}{{end}}
{{range datacenters}}{{if eq (env "CONSUL_DOMAIN") ""}}acl acl_{{$name}} hdr(host) -i {{$name}}.service.{{.}}.consul{{else}}acl acl_{{$name}} hdr(host) -i {{$name}}.service.{{.}}.{{env "CONSUL_DOMAIN"}}{{end}}
{{end}}{{if ne (env "HAPROXY_ADD_DOMAIN") ""}}acl acl_{{$name}} hdr(host) -i {{$name}}{{env "HAPROXY_ADD_DOMAIN"}}{{end}}
{{range .Tags}}{{if . | regexMatch "^haproxy_route=(.+)" }}acl acl_{{$name}} path_beg {{. | regexReplaceAll "haproxy_route=" ""}}/
{{end}}{{end}}
use_backend backend_{{$name}} if acl_{{$name}}

{{end}}{{end}}

acl acl_panteras hdr(host) -i localhost
acl acl_panteras hdr(host) 127.0.0.1
{{if ne (env "HOSTNAME") ""}}acl acl_panteras hdr(host) -i {{env "HOSTNAME"}}{{end}}
{{if ne (env "FQDN") ""}}acl acl_panteras hdr(host) -i {{env "FQDN" }}{{end}}
{{if ne (env "HOST_IP") ""}}acl acl_panteras hdr(host) {{env "HOST_IP" }}{{end}}
use_backend backend_panteras if acl_panteras

# BACKENDS
backend backend_panteras
errorfile 503 /etc/haproxy/errors/panteras.http

{{range services}}{{if .Tags | contains "haproxy" }}
# HTTP service: {{.Name}}
backend backend_{{.Name}}{{$key_maxconn := printf "/haproxy/%s/maxconn" .Name}}
balance roundrobin{{range $tag, $services := service .Name | byTag}}{{if $tag | regexMatch "^haproxy_httpchk=(.+)" }}
option {{$tag | regexReplaceAll "haproxy_httpchk=(.+)" "httpchk $1"}} {{end}}{{end}}
{{range service .Name}}{{if .Tags | contains "haproxy"}} server {{.Node}}_{{.Port}} {{.Address}}:{{.Port}} maxconn {{ key_or_default $key_maxconn "128" }} {{range .Tags}}{{if . | regexMatch "^haproxy_weight=([0-9]+)" }} {{. | regexReplaceAll "haproxy_weight=" "weight "}} {{end}}{{end}} check
{{end}}{{end}}{{end}}{{end}}

{{range services}}{{if .Tags | contains "haproxy"}}{{range .Tags}}{{if . | regexMatch "^haproxy_tcp=([0-9]+)" }}{{$tcp_port := . | regexReplaceAll "haproxy_tcp=" ""}}
# TCP forwarding service: {{.Name}}:{{$tcp_port}}
listen tcp_{{.Name}}
bind :{{$tcp_port}}
mode tcp
option tcplog
balance roundrobin
{{range service .Name}} server {{.Node}}_{{.Port}} {{.Address}}:{{.Port}} check
{{end}}{{end}}
{{end}}{{end}}{{end}}
2 changes: 1 addition & 1 deletion infrastructure/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.3.3
0.3.4

0 comments on commit fec11dc

Please sign in to comment.