updated haproxy state
This commit is contained in:
parent
62b8bbaba4
commit
b224c6843e
@ -23,6 +23,7 @@ http-response return status 404 content-type text/html string "<h1>404 not found
|
||||
{%- macro httpsslrules(h2=False) -%}ssl verify none{{ " alpn h2,http/1.1" if h2 }}{%- endmacro -%}
|
||||
|
||||
{%- macro httpendpoints(servers=[], check=True, disabled=False) -%}
|
||||
{%- if servers -%}
|
||||
{%- for server in servers %}
|
||||
{% if server.name in haproxy.servers.keys() -%}
|
||||
{%- set addr = haproxy.servers[server.name][0] -%}
|
||||
@ -31,9 +32,11 @@ http-response return status 404 content-type text/html string "<h1>404 not found
|
||||
{%- endif -%}
|
||||
server {{ server.name }} {{ addr }}:{{ server.port }}{{ " " + httpcheckrules(inter=server.inter|default("1s"), fall=server.fall|default(5), rise=server.rise|default(5)) if check }}{{ " " + httpsslrules(server.h2|default(False)) if server.ssl|default(False) }}{{ " disabled" if server.disabled|default(False) }}{{ " send-proxy" if server.proxy|default(False) }}{{ " on-marked-down shutdown-sessions on-marked-up shutdown-backup-sessions" if server.killsessions|default(False) }}
|
||||
{%- endfor %}
|
||||
{%- endif -%}
|
||||
{%- endmacro -%}
|
||||
|
||||
{%- macro tcpendpoints(servers=[], check=True) -%}
|
||||
{%- if servers -%}
|
||||
{%- for server in servers %}
|
||||
{% if server.name in haproxy.servers.keys() -%}
|
||||
{%- set addr = haproxy.servers[server.name][0] -%}
|
||||
@ -42,6 +45,7 @@ http-response return status 404 content-type text/html string "<h1>404 not found
|
||||
{%- endif -%}
|
||||
server {{ server.name }} {{ addr }}:{{ server.port }}{{ " check" if check }}{{ " backup" if server.backup|default(False) }} port {{ server.port }}{{ " on-marked-down shutdown-sessions on-marked-up shutdown-backup-sessions" if server.killsessions|default(False) }}
|
||||
{%- endfor %}
|
||||
{%- endif -%}
|
||||
{%- endmacro -%}
|
||||
|
||||
{%- macro cache() -%}
|
||||
@ -270,7 +274,7 @@ backend {{ name }} from {{ haproxy.config.namespace }}
|
||||
{%- if values.internal|default(False) %}
|
||||
{{ internal() }}
|
||||
{%- endif %}
|
||||
{{- httpendpoints(servers=values.servers, check=values.check|default(haproxy.config.check)) }}
|
||||
{{- httpendpoints(servers=values.servers|default([]), check=values.check|default(haproxy.config.check)) }}
|
||||
{%- endif %}
|
||||
{% endfor %}
|
||||
|
||||
@ -290,7 +294,7 @@ listen {{ name }} from {{ haproxy.config.namespace }}
|
||||
option spop-check
|
||||
{%- endif %}
|
||||
default-server inter 1s fall 5
|
||||
{{- tcpendpoints(servers=values.servers, check=values.check|default(haproxy.config.check)) }}
|
||||
{{- tcpendpoints(servers=values.servers|default([]), check=values.check|default(haproxy.config.check)) }}
|
||||
{% endfor %}
|
||||
|
||||
# SPOE Agents
|
||||
|
Loading…
Reference in New Issue
Block a user