Commit fc08c9bf authored by Geoff Simmons's avatar Geoff Simmons

Update haproxy dataplaneapi to version 2.3.1.

Closes #42
parent 2e4575bf
ARG go_version=1.15
ARG debian_tag=10.9-slim
ARG dataplane_version=v2.3.1
# Build k8s-crt-dnldr in the builder stage
FROM golang:${go_version} as builder
......@@ -11,33 +12,34 @@ RUN go get -d -v code.uplex.de/k8s/k8s-crt-dnldr/cmd
RUN cd /go/src/code.uplex.de/k8s/k8s-crt-dnldr && make k8s-crt-dnldr
RUN cd /go && git clone https://github.com/haproxytech/dataplaneapi.git && \
cd /go/dataplaneapi && git checkout ${dataplane_version} && make build
# Build haproxy
FROM debian:${debian_tag}
COPY buster-backports.list /etc/apt/sources.list.d/
ARG haproxy_version=2.2.9-1~bpo10+1
ARG dataplane_version=v1.2.4
RUN apt-get update -q && apt-get install -y -q curl && \
RUN apt-get update -q && \
apt-get install -y -q haproxy=${haproxy_version} && \
curl -L http://github.com/haproxytech/dataplaneapi/releases/download/${dataplane_version}/dataplaneapi -o /usr/bin/dataplaneapi && \
/bin/chmod 755 /usr/bin/dataplaneapi && \
apt-get install -y -q procps && \
apt-get remove -y -q curl && apt-get autoremove -y -q && apt-get clean && \
apt-get autoremove -y -q && apt-get clean && \
rm -rf /var/lib/apt/lists/* && rm -rf /etc/haproxy/errors && \
rm -rf /usr/share/doc && rm -rf /usr/share/man
COPY --from=builder /go/src/code.uplex.de/k8s/k8s-crt-dnldr/k8s-crt-dnldr /usr/bin/
COPY --from=builder /go/dataplaneapi/build/dataplaneapi /usr/bin/
COPY haproxy.cfg /etc/haproxy/
RUN /bin/chmod 755 /usr/bin/dataplaneapi
# GID 998 is the varnish group in the varnish container.
RUN /bin/mkdir /run/haproxy/ && \
RUN /bin/mkdir -p /run/haproxy/spoe && \
/usr/sbin/groupadd -g 998 varnish && \
/usr/sbin/usermod -G varnish -g varnish -u 102 haproxy && \
/bin/chgrp varnish /run/haproxy && \
/bin/chmod 775 /run/haproxy
/bin/chgrp -R varnish /run/haproxy && \
/bin/chmod -R 775 /run/haproxy
COPY haproxy_exec.sh /
RUN /bin/chmod 755 /haproxy_exec.sh /usr/bin/k8s-crt-dnldr
......
......@@ -28,7 +28,7 @@ userlist controller
user dataplaneapi insecure-password %%SECRET_DATAPLANEAPI%%
program api
command /usr/bin/dataplaneapi --host=0.0.0.0 --port=5555 --haproxy-bin /usr/sbin/haproxy --reload-cmd "/bin/kill -SIGUSR2 1" -i --log-to=stdout --log-level=info
command /usr/bin/dataplaneapi --host=0.0.0.0 --port=5555 --haproxy-bin /usr/sbin/haproxy --reload-cmd "/bin/kill -SIGUSR2 1" -i --log-to=stdout --log-level=info -f=/run/haproxy/dataplaneapi.hcl -c /run/haproxy/haproxy.cfg -p /run/haproxy/maps --ssl-certs-dir=/etc/ssl/private --spoe-dir=/run/haproxy/spoe
no option start-on-reload
program crt-dnldr
......
......@@ -5,8 +5,10 @@ go 1.15
require (
code.uplex.de/uplex-varnish/varnishapi v0.0.0-20191205154529-31e610a4139d
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883
github.com/go-openapi/spec v0.19.2 // indirect
github.com/go-openapi/strfmt v0.19.0
github.com/go-openapi/errors v0.19.4 // indirect
github.com/go-openapi/strfmt v0.19.5
github.com/go-openapi/swag v0.19.9 // indirect
github.com/go-openapi/validate v0.19.8 // indirect
github.com/golang/groupcache v0.0.0-20181024230925-c65c006176ff // indirect
github.com/google/go-cmp v0.3.0
github.com/googleapis/gnostic v0.2.0 // indirect
......
This diff is collapsed.
......@@ -47,9 +47,9 @@ var fmts = strfmt.NewFormats()
const (
dataplaneUser = "dataplaneapi"
txPath = "/v1/services/haproxy/transactions"
sitesPath = "/v1/services/haproxy/sites"
reloadsPath = "/v1/services/haproxy/reloads"
txPath = "/v2/services/haproxy/transactions"
sitesPath = "/v2/services/haproxy/sites"
reloadsPath = "/v2/services/haproxy/reloads"
versionHdr = "Configuration-Version"
reloadIDHdr = "Reload-ID"
varnishSock = "unix@/varnish.sock"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment