aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Jastrzebski (inc0) <michal.jastrzebski@intel.com>2015-07-17 12:19:02 +0200
committerMichal Jastrzebski (inc0) <michal.jastrzebski@intel.com>2015-07-21 15:32:39 +0200
commit38bed674bd522d8e23d5c9ca66d356c4c5884ce7 (patch)
treeebac53445f55144b0c92d82d6cdd1c3d35e74828
parent73028912069fb4048891a70842753a268cb5288b (diff)
downloadkolla-38bed674bd522d8e23d5c9ca66d356c4c5884ce7.tar.gz
kolla-38bed674bd522d8e23d5c9ca66d356c4c5884ce7.zip
HAProxy container
This commit consists HAProxy container. It only supports config-external as this requires orchiestration. Change-Id: I0af28be4f3d4aa40c418f15c40c45630d0fd7c8d Partially-implements: blueprint haproxy-container
-rwxr-xr-xdocker/centos/binary/haproxy/Dockerfile11
l---------docker/centos/binary/haproxy/build1
l---------docker/centos/binary/haproxy/config-external.sh1
l---------docker/centos/binary/haproxy/start.sh1
-rwxr-xr-xdocker/common/haproxy/config-external.sh11
-rwxr-xr-xdocker/common/haproxy/start.sh17
-rw-r--r--docs/minimal-environment-vars.md4
7 files changed, 46 insertions, 0 deletions
diff --git a/docker/centos/binary/haproxy/Dockerfile b/docker/centos/binary/haproxy/Dockerfile
new file mode 100755
index 000000000..40f2af610
--- /dev/null
+++ b/docker/centos/binary/haproxy/Dockerfile
@@ -0,0 +1,11 @@
+FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%base:%%KOLLA_TAG%%
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+RUN yum -y install \
+ haproxy \
+ && yum clean all
+
+COPY start.sh /
+COPY config-external.sh /opt/kolla/
+
+CMD ["/start.sh"]
diff --git a/docker/centos/binary/haproxy/build b/docker/centos/binary/haproxy/build
new file mode 120000
index 000000000..8d652f7ee
--- /dev/null
+++ b/docker/centos/binary/haproxy/build
@@ -0,0 +1 @@
+../../../../tools/build-docker-image \ No newline at end of file
diff --git a/docker/centos/binary/haproxy/config-external.sh b/docker/centos/binary/haproxy/config-external.sh
new file mode 120000
index 000000000..75dc2b408
--- /dev/null
+++ b/docker/centos/binary/haproxy/config-external.sh
@@ -0,0 +1 @@
+../../../common/haproxy/config-external.sh \ No newline at end of file
diff --git a/docker/centos/binary/haproxy/start.sh b/docker/centos/binary/haproxy/start.sh
new file mode 120000
index 000000000..9b9c71e73
--- /dev/null
+++ b/docker/centos/binary/haproxy/start.sh
@@ -0,0 +1 @@
+../../../common/haproxy/start.sh \ No newline at end of file
diff --git a/docker/common/haproxy/config-external.sh b/docker/common/haproxy/config-external.sh
new file mode 100755
index 000000000..d267eb195
--- /dev/null
+++ b/docker/common/haproxy/config-external.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+SOURCE="/opt/kolla/haproxy/haproxy.cfg"
+TARGET="/etc/haproxy/haproxy.cfg"
+OWNER="root"
+
+if [[ -f "$SOURCE" ]]; then
+ rm $TARGET
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
diff --git a/docker/common/haproxy/start.sh b/docker/common/haproxy/start.sh
new file mode 100755
index 000000000..68600f44e
--- /dev/null
+++ b/docker/common/haproxy/start.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+set -o errexit
+
+CMD='/usr/sbin/haproxy'
+# Parameters:
+# -db for non-daemon execution and logging to stdout
+# -p pidfile to specify pidfile and allow hot reconfiguration
+# loop which generates -f file.conf for each file in /etc/haproxy and /etc/haproxy/conf.d
+ARGS="-db -f /etc/haproxy/haproxy.cfg"
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+# Config-internal script exec out of this function, it does not return here.
+set_configs
+
+exec $CMD $ARGS
diff --git a/docs/minimal-environment-vars.md b/docs/minimal-environment-vars.md
index 53c68af54..0bf21ecc6 100644
--- a/docs/minimal-environment-vars.md
+++ b/docs/minimal-environment-vars.md
@@ -229,6 +229,10 @@ In order for each service to function, there is a minimum set of required variab
GLANCE_DB_USER
MARIADB_SERVICE_HOST
+# Haproxy
+
+ None
+
# Hautoproxy
None