From f889527cc72b5a4f6e6254c1673b36f61d4f2b84 Mon Sep 17 00:00:00 2001 From: holzi1005 Date: Fri, 8 Aug 2025 19:02:06 +0200 Subject: [PATCH] Update README_GO.md --- README_GO.md | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/README_GO.md b/README_GO.md index 34c0ef6..54e0e99 100644 --- a/README_GO.md +++ b/README_GO.md @@ -48,8 +48,8 @@ Environment=KUBERNETES_HOST=https://10.0.20.7:6443 Environment=KUBERNETES_TOKEN=eyJhbGciOi... Environment=KUBERNETES_VERIFYSSL=false Environment=HAPROXY_TEMPLATE=/etc/haproxy/haproxy.tmpl -ExecStart=/path/to/haproxy-generator > /etc/haproxy/haproxy.cfg -ExecStartPost=/bin/systemctl restart haproxy +ExecStart=/path/to/haproxy-generator > /etc/haproxy/haproxy.cfg.new +ExecStartPost=/bin/bash /etc/haproxy/haproxy-generator-post.sh ``` @@ -69,6 +69,23 @@ WantedBy=timers.target ``` +# Reload Script for post start + +Copy the script to /etc/haproxy/haproxy-generator-post.sh +``` +#!/bin/bash + +DIFF=$(diff /etc/haproxy/haproxy.cfg /etc/haproxy/haproxy.cfg.new) +/sbin/haproxy -f /etc/haproxy/haproxy.cfg.new -c +VALID=$? + +if [ "$DIFF" != "" ] && [ $VALID -eq 0 ] +then + mv /etc/haproxy/haproxy.cfg.new /etc/haproxy/haproxy.cfg + /usr/sbin/service haproxy restart +fi +``` + # Service Annotations | Annotation-Key | Beschreibung | Typ | Beispielwert |