This commit is contained in:
parent
d010200de7
commit
f797d909cf
1 changed files with 5 additions and 3 deletions
|
@ -12,8 +12,6 @@ export HAPROXY_TEMPLATE="./haproxy.tmpl"
|
||||||
# HaProxy Template
|
# HaProxy Template
|
||||||
|
|
||||||
```
|
```
|
||||||
{{- range .backends }}
|
|
||||||
|
|
||||||
backend {{ .Name }}
|
backend {{ .Name }}
|
||||||
mode {{ .Mode }}
|
mode {{ .Mode }}
|
||||||
balance {{ .Balance }}
|
balance {{ .Balance }}
|
||||||
|
@ -21,12 +19,16 @@ backend {{ .Name }}
|
||||||
cookie {{ .CookieName }} {{ .CookieFlags }}
|
cookie {{ .CookieName }} {{ .CookieFlags }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
|
{{- if .HealthCheck }}
|
||||||
|
option httpchk GET {{ .HealthCheck }}
|
||||||
|
http-check expect status 200
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
{{- $backend := . }}
|
{{- $backend := . }}
|
||||||
{{- range .Servers }}
|
{{- range .Servers }}
|
||||||
server {{ .Name }} {{ .Address }}:{{ .Port }}{{ if $backend.HealthCheck }} check{{ end }}{{ if $backend.CookieName }} cookie {{ .Cookie }}{{ end }}{{ if $backend.ServerOptions }} {{ $backend.ServerOptions }}{{ end }}
|
server {{ .Name }} {{ .Address }}:{{ .Port }}{{ if $backend.HealthCheck }} check{{ end }}{{ if $backend.CookieName }} cookie {{ .Cookie }}{{ end }}{{ if $backend.ServerOptions }} {{ $backend.ServerOptions }}{{ end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
{{- end }}
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue