haproxy-kubernetes/haproxy.j2
2024-12-21 19:40:02 +01:00

31 lines
868 B
Django/Jinja

global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin
stats timeout 30s
user haproxy
group haproxy
daemon
defaults
log global
option dontlognull
timeout connect 5000
timeout client 50000
timeout server 50000
{% for backend in backends %}
backend {{ backend.name }}
mode {{ backend.mode }}
balance {{ backend.balance }}
{% for key, value in backend.labels %}
{% if 'haproxy_backend_option_' in key %}
{{ value }}
{% endif %}
{% endfor %}
{% for server in backend.servers -%}
{{ server }}{% for key, value in backend.labels %}{% if 'haproxy_server_config_' in key %} {{ value }}{% endif %}{% endfor %}
{% endfor %}
{% endfor %}