From b81d77686d51b947ebcc74d6b2ecbe43df581815 Mon Sep 17 00:00:00 2001 From: Sielski Date: Fri, 27 Jan 2017 22:38:19 +0100 Subject: [PATCH 1/2] Version up + alternative haproxy config for testing --- generate_yml.sh | 1 + infrastructure/Dockerfile | 8 +++--- infrastructure/haproxy.cfg.ctmpl.test | 41 +++++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 4 deletions(-) create mode 100644 infrastructure/haproxy.cfg.ctmpl.test diff --git a/generate_yml.sh b/generate_yml.sh index d5e985b..58b6542 100755 --- a/generate_yml.sh +++ b/generate_yml.sh @@ -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}" # diff --git a/infrastructure/Dockerfile b/infrastructure/Dockerfile index 3bc6623..d4f313c 100644 --- a/infrastructure/Dockerfile +++ b/infrastructure/Dockerfile @@ -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 diff --git a/infrastructure/haproxy.cfg.ctmpl.test b/infrastructure/haproxy.cfg.ctmpl.test new file mode 100644 index 0000000..617117e --- /dev/null +++ b/infrastructure/haproxy.cfg.ctmpl.test @@ -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}} From f7ce5a3607a50af8eddc1050b58d9ff9102ae2e2 Mon Sep 17 00:00:00 2001 From: Sielski Date: Fri, 27 Jan 2017 22:40:00 +0100 Subject: [PATCH 2/2] PaaS Version up --- README.md | 4 ++-- infrastructure/version | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index db540c8..9c59744 100644 --- a/README.md +++ b/README.md @@ -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
_entire_ Platform as a Service, in a box _"One container to rule them all"_ @@ -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 diff --git a/infrastructure/version b/infrastructure/version index 1c09c74..42045ac 100644 --- a/infrastructure/version +++ b/infrastructure/version @@ -1 +1 @@ -0.3.3 +0.3.4