13 Commits

Author SHA1 Message Date
Monty Taylor
5de73f6c36 Use explicit image paths
To make it clear that docker hub is but one of many possible registries,
update our usage of FROM and image: lines to include docker.io in the
path.

There are a few other FROM lines for the gitea images which are handled
in a separate stack.

Change-Id: I6fafd5f659ad19de6951574afc9a6b6a4cf184df
2019-12-17 08:13:34 -05:00
Zuul
60d4a1bdd3 Merge "Reload haproxy configuration when config changes" 2019-07-23 18:55:05 +00:00
Jeremy Stanley
df23d48949 Reload haproxy configuration when config changes
Add an Ansible handler to send a hangup signal through
docker-compose to the running haproxy daemon any time the task to
update its configuration fires.

Change-Id: I1946c1e7eaaa8a8e2209007b5d065dba952ec6e2
2019-07-23 16:48:23 +00:00
Clark Boylan
08a113d4a8 Actually check backends are alive in haproxy
This adds the simplest form of health checking to haproxy, a tcp check
to the backends. We can do more sophisticated checks like checking ssl
negotiates or even HTTP requests but for now this is probably a good
improvement.

Change-Id: I3c6b07df4b3e0c380c757e1e5cb51ae0be655f34
2019-07-23 08:13:12 -07:00
Clark Boylan
d80f4a93ab Collect haproxy logs via syslog
Haproxy wants to log to syslog (and not stdout for performance reasons,
see https://github.com/dockerfile/haproxy/issues/3). However there is no
running syslog in our haproxy container. What we can do is mount in the
host's /dev/log and have haproxy write to the hosts syslog to get
logging.

Do this via a docker compose volume bind mount.

Change-Id: Icf4a91c2bc5f5dbb0bfb9d36e7ec0210c6dc4e90
2019-07-17 13:40:53 -07:00
Clark Boylan
b50a748d44 Switch git lb to source balance method
We were using the leastconn method which sends new connections to the
backend with the least number of connections. Unfortunately git clients
seem to have trouble with varying backend repo state (due to GC and
packing) and the thought is sending all requests from a single client to
a single backend will alleviate this.

To do this we switch to the source balance method which hashes the
source IP and finds a stable backend to talk to. This method handles
backend outages fine as it will hash to a new backend if the older one
goes offline.

Change-Id: I2c7a4ec0809a2f4ef6556833ac6a0ff3651904dd
2019-05-28 08:17:05 -07:00
James E. Blair
5faf89f566 Add haproxy-statsd to haproxy server
Build a container image with the haproxy-statsd script, and run that
along with the haproxy container.

Change-Id: I18be70d339df613bf9a72e115e80a6da876111e0
2019-05-24 15:40:28 -07:00
Zuul
157ad6d521 Merge "Prune docker images after docker-compose up" 2019-05-16 22:55:04 +00:00
Clark Boylan
625d45567f Install socat where we install haproxy
Socat is useful for managing haproxy through the haproxy management
socket. Install it when we install haproxy.

Change-Id: Ie2b16cef62f661669756d24d4a69ac1683401268
2019-05-03 08:18:05 -07:00
Clark Boylan
f4bf952f34 Prune docker images after docker-compose up
This ensures that we cleanup images that are superceded and no longer
necessary. We do this to avoid filling the disk with docker images.

Note that we use the -f flag to avoid being prompted by docker image
prune for confirmation.

Change-Id: I8eb5bb97d8c66755e695498707220c9e6e7b2de0
2019-05-02 15:09:37 -07:00
James E. Blair
65563f226e Bind to v4 and v6 in haproxy
Also, add a newline between listener stanzas in the config for
readability.

Change-Id: I599ca06f933e746fae3769e7872ae9911c4b00ed
2019-04-18 15:38:15 -07:00
James E. Blair
4d91f29b39 Run docker-compose pull before docker-compose up
This will make sure that the latest relevant images are in the
local image storage, and therefore, will cause docker-compose up
to recreate containers when the images are updated.

Change-Id: Ic6f0bc8c8aea5b5c16501f4ab5d3095fb70c0ff7
2019-03-04 14:40:35 -08:00
James E. Blair
4b031f9f24 Run an haproxy load balancer for gitea
This runs an haproxy which is strikingly similar to the one we
currently run for git.openstack.org, but it is run in a docker
container.

Change-Id: I647ae8c02eb2cd4f3db2b203d61a181f7eb632d2
2019-02-22 12:54:04 -08:00