Skip to content
This repository was archived by the owner on Jul 2, 2024. It is now read-only.

Commit 6f6f8fe

Browse files
authored
Merge pull request #98 from jdeathe/centos-7-develop
Release changes for 2.2.0
2 parents 24cf68e + 5b4daaa commit 6f6f8fe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+2846
-1176
lines changed

.dockerignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1+
.env
2+
.env.example
13
.git
24
.gitignore
35
dist
46
test
7+
var
8+
docker-compose.yml
9+
docker-compose-*.yml
510
LICENSE
611
README-short.txt
712
*.md

.env.example

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
APACHE_SSL_CERTIFICATE=/run/secrets/haproxy_ssl_certificate
2+
3+
HAPROXY_SSL_CERTIFICATE=/run/secrets/haproxy_ssl_certificate
4+
HAPROXY_CONFIG=/etc/haproxy/haproxy-http.cfg
5+
HAPROXY_HOST_NAMES=www.app.local app.local localhost.localdomain
6+
7+
VARNISH_MAX_THREADS=2000
8+
VARNISH_MIN_THREADS=100
9+
VARNISH_OPTIONS=
10+
VARNISH_STORAGE=malloc,256M
11+
VARNISH_THREAD_TIMEOUT=120
12+
VARNISH_TTL=120
13+
VARNISH_VARNISHNCSA_FORMAT=%h %l %u %t "%r" %s %b "%{Referer}i" "%{User-Agent}i"
14+
VARNISH_VARNISHNCSA_OPTIONS=
15+
VARNISH_VCL_CONF=/etc/varnish/docker-default.vcl

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
.env
12
dist

CHANGELOG.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,40 @@ Summary of release changes for Version 2.
66

77
CentOS-7 7.5.1804 x86_64 - HAProxy 1.8 / HATop 0.7.
88

9+
### 2.2.0 - 2019-05-30
10+
11+
- Updates `haproxy18u` packages to 1.8.19-1.
12+
- Updates source image to [2.5.1](https://github.com/jdeathe/centos-ssh/releases/tag/2.5.1).
13+
- Updates and restructures Dockerfile.
14+
- Updates container naming conventions and readability of `Makefile`.
15+
- Updates healthcheck retries to 4.
16+
- Updates docker-compose configuration examples.
17+
- Updates default tls/ssl certificate name from `localhost.localdomain.crt` to `localhost.crt`.
18+
- Fixes issue with unexpected published port in run templates when `DOCKER_PORT_MAP_TCP_80` or `DOCKER_PORT_MAP_TCP_443` is set to an empty string or 0.
19+
- Fixes binary paths in systemd unit files for compatibility with both EL and Ubuntu hosts.
20+
- Fixes environment variable name typo in README for `HAPROXY_CONFIG`.
21+
- Adds port incrementation to Makefile's run template for container names with an instance suffix.
22+
- Adds placeholder replacement of `RELEASE_VERSION` docker argument to systemd service unit template.
23+
- Adds improvement to pull logic in systemd unit install template.
24+
- Adds `SSH_AUTOSTART_SUPERVISOR_STDOUT` with a value "false", disabling startup of `supervisor_stdout`.
25+
- Adds improved logging output.
26+
- Adds consideration for event lag into test cases for unhealthy health_status events.
27+
- Adds error messages to healthcheck script and includes supervisord check.
28+
- Adds improved `healtchcheck`, `haproxy-wrapper` and `rsyslogd-wrapper` scripts.
29+
- Adds improved lock/state file implementation in wrapper scripts.
30+
- Adds config path and tls/ssl certificate fingerprint to `haproxy-wrapper` Details output.
31+
- Adds support for hitless reload via `haproxy-wrapper`.
32+
- Adds configuration of Apache certificate via `APACHE_SSL_CERTIFICATE` in `.env` for the tcp example.
33+
- Adds SNI forwarding in the TLS/SSL tcp example configuration.
34+
- Adds `/status` (`monitor-uri`) endpoints and custom error responses to http example configuration.
35+
- Adds `socat` package to the image to allow for non-interactive HAProxy CLI usage.
36+
- Removes use of `/etc/services-config` paths.
37+
- Removes the unused group element from the default container name.
38+
- Removes the node element from the default container name.
39+
- Removes unused environment variables from Makefile and scmi configuration.
40+
- Removes X-Fleet section from etcd register template unit-file.
41+
- Removes use of `stick-table` in `haproxy-tcp.cfg` as it should not be necessary for web backends that support shared persistence/session data stores.
42+
943
### 2.1.1 - 2018-12-27
1044

1145
- Updates `haproxy18u` packages to 1.8.14-1.

Dockerfile

Lines changed: 67 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -1,162 +1,103 @@
1-
# =============================================================================
2-
# jdeathe/centos-ssh-haproxy
3-
# =============================================================================
4-
FROM jdeathe/centos-ssh:2.4.1
1+
FROM jdeathe/centos-ssh:2.5.1
52

63
ARG HATOP_VERSION="0.7.7"
4+
ARG RELEASE_VERSION="2.2.0"
75

8-
# -----------------------------------------------------------------------------
9-
# Install HAProxy
10-
# -----------------------------------------------------------------------------
11-
RUN rpm --rebuilddb \
12-
&& yum -y install \
6+
# ------------------------------------------------------------------------------
7+
# Base install of required packages
8+
# ------------------------------------------------------------------------------
9+
RUN yum -y install \
1310
--setopt=tsflags=nodocs \
1411
--disableplugin=fastestmirror \
15-
haproxy18u-1.8.14-1.ius.centos7 \
12+
haproxy18u-1.8.19-1.ius.centos7 \
1613
rsyslog-8.24.0-34.el7 \
14+
socat-1.7.3.2-2.el7 \
1715
&& yum versionlock add \
1816
haproxy \
1917
rsyslog \
18+
socat \
2019
&& yum clean all \
21-
&& mv \
22-
/etc/haproxy/haproxy.cfg \
23-
/etc/haproxy/haproxy.cfg.default \
24-
&& mkdir -p \
25-
/etc/pki/tls/certs/sni
26-
27-
# -----------------------------------------------------------------------------
28-
# Enable local syslog logging
29-
# -----------------------------------------------------------------------------
30-
RUN sed -i \
31-
-e 's~^#\$ModLoad imudp$~\$ModLoad imudp~' \
32-
-e 's~^#\$UDPServerRun 514$~\$UDPServerRun 514~' \
33-
-e 's~^\(\$OmitLocalLogging .*\)$~#\1~' \
34-
-e 's~^\(\$ModLoad imuxsock .*\)$~#\1~' \
35-
-e 's~^\(\$ModLoad imjournal .*\)$~#\1~' \
36-
-e 's~^\(\$IMJournalStateFile .*\)$~#\1~' \
37-
/etc/rsyslog.conf \
38-
&& mkdir -p \
39-
/run/systemd/journal \
40-
&& { \
41-
echo '$UDPServerAddress 127.0.0.1'; \
42-
echo 'local2.* /var/log/haproxy.log'; \
43-
echo '& stop'; \
44-
} > /etc/rsyslog.d/listen.conf
45-
46-
# -----------------------------------------------------------------------------
47-
# Install HATop
48-
# usage: env TERM=xterm hatop -s /var/lib/haproxy/stats
49-
# -----------------------------------------------------------------------------
50-
RUN curl -LsSO \
20+
&& curl -LsSO \
5121
https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/hatop/hatop-${HATOP_VERSION}.tar.gz \
5222
&& tar -xzf hatop-${HATOP_VERSION}.tar.gz \
5323
&& cd hatop-${HATOP_VERSION} \
5424
&& install \
5525
-m 0755 \
5626
bin/hatop \
5727
/usr/local/bin \
58-
&& rm -rf /hatop-${HATOP_VERSION}* \
59-
&& echo 'alias hatop="hatop -s /var/lib/haproxy/stats-1 -i 1"' \
60-
> /etc/profile.d/hatop.sh
61-
62-
# -----------------------------------------------------------------------------
63-
# Increase the system limits
64-
# -----------------------------------------------------------------------------
65-
RUN { \
66-
echo ''; \
67-
echo -e 'haproxy\tsoft\tnofile\t8388608'; \
68-
echo -e 'haproxy\thard\tnofile\t16777216'; \
69-
} >> /etc/security/limits.conf
28+
&& rm -rf /hatop-${HATOP_VERSION}*
7029

71-
# -----------------------------------------------------------------------------
30+
# ------------------------------------------------------------------------------
7231
# Copy files into place
73-
# -----------------------------------------------------------------------------
74-
ADD src/usr/bin \
75-
/usr/bin/
76-
ADD src/usr/sbin \
77-
/usr/sbin/
78-
ADD src/opt/scmi \
79-
/opt/scmi/
80-
ADD src/etc/services-config/haproxy \
81-
/etc/services-config/haproxy/
82-
ADD src/etc/services-config/supervisor/supervisord.d \
83-
/etc/services-config/supervisor/supervisord.d/
84-
ADD src/etc/systemd/system \
85-
/etc/systemd/system/
32+
# ------------------------------------------------------------------------------
33+
ADD src /
8634

87-
RUN ln -sf \
88-
/etc/services-config/haproxy/haproxy-http.example.cfg \
35+
# ------------------------------------------------------------------------------
36+
# Provisioning
37+
# - Increase the system limits
38+
# - Add required directories
39+
# - Enable local syslog logging
40+
# - Add hatop alias
41+
# - Replace placeholders with values in systemd service unit template
42+
# - Backup default haproxy configuration
43+
# - Replace default haproxy configuration with haproxy-http.cfg
44+
# - Set permissions
45+
# ------------------------------------------------------------------------------
46+
RUN { printf -- \
47+
'\nhaproxy\tsoft\tnofile\t%s\nhaproxy\thard\tnofile\t%s\n' \
48+
'8388608' \
49+
'16777216'; \
50+
} >> /etc/security/limits.conf \
51+
&& mkdir -p \
52+
{/etc/pki/tls/certs/sni,/run/systemd/journal} \
53+
&& sed -i \
54+
-e 's~^#\$ModLoad imudp$~\$ModLoad imudp~' \
55+
-e 's~^#\$UDPServerRun 514$~\$UDPServerRun 514~' \
56+
-e 's~^\(\$OmitLocalLogging .*\)$~#\1~' \
57+
-e 's~^\(\$ModLoad imjournal .*\)$~#\1~' \
58+
-e 's~^\(\$ModLoad imklog .*\)$~#\1~' \
59+
-e 's~^\(\$ModLoad imuxsock .*\)$~#\1~' \
60+
-e 's~^\(\$IMJournalStateFile .*\)$~#\1~' \
61+
/etc/rsyslog.conf \
62+
&& { printf -- \
63+
'$UDPServerAddress %s\nlocal2.* %s\n& stop\n' \
64+
'127.0.0.1' \
65+
'/dev/stdout'; \
66+
} > /etc/rsyslog.d/listen.conf \
67+
&& printf -- 'alias hatop="%s"' \
68+
"hatop -s /var/lib/haproxy/stats-1 -i 1" \
69+
> /etc/profile.d/hatop.sh \
70+
&& sed -i \
71+
-e "s~{{RELEASE_VERSION}}~${RELEASE_VERSION}~g" \
72+
/etc/systemd/system/[email protected] \
73+
&& mv \
8974
/etc/haproxy/haproxy.cfg \
90-
&& ln -sf \
91-
/etc/services-config/haproxy/haproxy-http.example.cfg \
75+
/etc/haproxy/haproxy.cfg.default \
76+
&& cp \
9277
/etc/haproxy/haproxy-http.cfg \
93-
&& ln -sf \
94-
/etc/services-config/haproxy/haproxy-http-proxy.example.cfg \
95-
/etc/haproxy/haproxy-http-proxy.cfg \
96-
&& ln -sf \
97-
/etc/services-config/haproxy/haproxy-h2.example.cfg \
98-
/etc/haproxy/haproxy-h2.cfg \
99-
&& ln -sf \
100-
/etc/services-config/haproxy/haproxy-h2-proxy.example.cfg \
101-
/etc/haproxy/haproxy-h2-proxy.cfg \
102-
&& ln -sf \
103-
/etc/services-config/haproxy/haproxy-tcp.example.cfg \
104-
/etc/haproxy/haproxy-tcp.cfg \
105-
&& ln -sf \
106-
/etc/services-config/haproxy/haproxy-bootstrap.conf \
107-
/etc/haproxy-bootstrap.conf \
108-
&& ln -sf \
109-
/etc/services-config/haproxy/400.html.http \
110-
/etc/haproxy/400.html.http \
111-
&& ln -sf \
112-
/etc/services-config/haproxy/403.html.http \
113-
/etc/haproxy/403.html.http \
114-
&& ln -sf \
115-
/etc/services-config/haproxy/408.html.http \
116-
/etc/haproxy/408.html.http \
117-
&& ln -sf \
118-
/etc/services-config/haproxy/500.html.http \
119-
/etc/haproxy/500.html.http \
120-
&& ln -sf \
121-
/etc/services-config/haproxy/502.html.http \
122-
/etc/haproxy/502.html.http \
123-
&& ln -sf \
124-
/etc/services-config/haproxy/503.html.http \
125-
/etc/haproxy/503.html.http \
126-
&& ln -sf \
127-
/etc/services-config/haproxy/504.html.http \
128-
/etc/haproxy/504.html.http \
129-
&& ln -sf \
130-
/etc/services-config/supervisor/supervisord.d/haproxy-bootstrap.conf \
131-
/etc/supervisord.d/haproxy-bootstrap.conf \
132-
&& ln -sf \
133-
/etc/services-config/supervisor/supervisord.d/haproxy-wrapper.conf \
134-
/etc/supervisord.d/haproxy-wrapper.conf \
135-
&& ln -sf \
136-
/etc/services-config/supervisor/supervisord.d/rsyslogd-wrapper.conf \
137-
/etc/supervisord.d/rsyslogd-wrapper.conf \
78+
/etc/haproxy/haproxy.cfg \
13879
&& chmod 600 \
139-
/etc/services-config/haproxy/{haproxy-{http,http-proxy,h2,h2-proxy,tcp}.example.cfg,{400,403,408,500,502,503,504}.html.http} \
80+
/etc/haproxy/{{haproxy,haproxy-{http,http-proxy,h2,h2-proxy,tcp}}.cfg,{400,403,408,500,502,503,504}.html.http} \
14081
&& chmod 600 \
141-
/etc/services-config/supervisor/supervisord.d/{haproxy-bootstrap,{haproxy,rsyslogd}-wrapper}.conf \
82+
/etc/supervisord.d/{haproxy-bootstrap,{haproxy,rsyslogd}-wrapper}.conf \
14283
&& chmod 700 \
14384
/usr/{bin/healthcheck,sbin/{haproxy-bootstrap,{haproxy,rsyslogd}-wrapper}}
14485

14586
EXPOSE 80 443
14687

147-
# -----------------------------------------------------------------------------
88+
# ------------------------------------------------------------------------------
14889
# Set default environment variables
149-
# -----------------------------------------------------------------------------
90+
# ------------------------------------------------------------------------------
15091
ENV HAPROXY_SSL_CERTIFICATE="" \
15192
HAPROXY_CONFIG="/etc/haproxy/haproxy.cfg" \
15293
HAPROXY_HOST_NAMES="localhost.localdomain" \
153-
SSH_AUTOSTART_SSHD=false \
154-
SSH_AUTOSTART_SSHD_BOOTSTRAP=false
94+
SSH_AUTOSTART_SSHD="false" \
95+
SSH_AUTOSTART_SSHD_BOOTSTRAP="false" \
96+
SSH_AUTOSTART_SUPERVISOR_STDOUT="false"
15597

156-
# -----------------------------------------------------------------------------
98+
# ------------------------------------------------------------------------------
15799
# Set image metadata
158-
# -----------------------------------------------------------------------------
159-
ARG RELEASE_VERSION="2.1.1"
100+
# ------------------------------------------------------------------------------
160101
LABEL \
161102
maintainer="James Deathe <[email protected]>" \
162103
install="docker run \
@@ -186,9 +127,9 @@ jdeathe/centos-ssh-haproxy:${RELEASE_VERSION} \
186127
org.deathe.description="CentOS-7 7.5.1804 x86_64 - HAProxy 1.8 / HATop 0.7."
187128

188129
HEALTHCHECK \
189-
--interval=0.5s \
130+
--interval=1s \
190131
--timeout=1s \
191132
--retries=4 \
192133
CMD ["/usr/bin/healthcheck"]
193134

194-
CMD ["/usr/bin/supervisord", "--configuration=/etc/supervisord.conf"]
135+
CMD ["/usr/bin/supervisord", "--configuration=/etc/supervisord.conf"]

0 commit comments

Comments
 (0)