Merge "Add haproxy startup script"

This commit is contained in:
Zuul
2025-09-09 18:56:08 +00:00
committed by Gerrit Code Review

View File

@@ -0,0 +1,20 @@
#!/bin/bash
set -exuo pipefail
IMAGE_HAPROXY="{{ config['HostSystem:images.haproxy'] }}"
while true; do
if systemctl is-active kubelet && [[ -e /etc/kubernetes/manifests/haproxy.yaml ]]; then
if docker ps | grep -q haproxy; then
docker stop -t 10 haproxy
fi
break
else
if ! docker ps | grep -q haproxy; then
docker run --rm -d --net host -v /etc/promenade/haproxy:/usr/local/etc/haproxy:ro \
--name haproxy "$IMAGE_HAPROXY"
fi
sleep 5
fi
done