This commit is contained in:
parent
cc95c8b704
commit
08f953b7ef
1 changed files with 35 additions and 0 deletions
35
README_GO.md
35
README_GO.md
|
@ -25,4 +25,39 @@ backend {{ .Name }}
|
|||
|
||||
{{- end }}
|
||||
|
||||
```
|
||||
|
||||
|
||||
# Systemd Service and Timer
|
||||
|
||||
```
|
||||
[Unit]
|
||||
Description=HAProxy Config Generator
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
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
|
||||
|
||||
```
|
||||
|
||||
Timer for Systemd
|
||||
```
|
||||
[Unit]
|
||||
Description=Run HAProxy Config Generator every minute
|
||||
|
||||
[Timer]
|
||||
OnBootSec=1min
|
||||
OnUnitActiveSec=1min
|
||||
Unit=haproxy-generator.service
|
||||
Persistent=true
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
|
||||
```
|
Loading…
Add table
Reference in a new issue