This commit is contained in:
parent
f889527cc7
commit
91fbebd25e
1 changed files with 3 additions and 3 deletions
|
@ -48,8 +48,7 @@ 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.new
|
||||
ExecStartPost=/bin/bash /etc/haproxy/haproxy-generator-post.sh
|
||||
ExecStart=/bin/bash /etc/haproxy/haproxy-generator.sh
|
||||
|
||||
```
|
||||
|
||||
|
@ -71,10 +70,11 @@ WantedBy=timers.target
|
|||
|
||||
# Reload Script for post start
|
||||
|
||||
Copy the script to /etc/haproxy/haproxy-generator-post.sh
|
||||
Copy the script to /etc/haproxy/haproxy-generator.sh
|
||||
```
|
||||
#!/bin/bash
|
||||
|
||||
/usr/local/bin/haproxy-generator > /etc/haproxy/haproxy.cfg.new
|
||||
DIFF=$(diff /etc/haproxy/haproxy.cfg /etc/haproxy/haproxy.cfg.new)
|
||||
/sbin/haproxy -f /etc/haproxy/haproxy.cfg.new -c
|
||||
VALID=$?
|
||||
|
|
Loading…
Add table
Reference in a new issue