ad dlables

This commit is contained in:
holzi1005 2024-12-21 19:40:02 +01:00
parent bb248f41e5
commit c73db134d5
2 changed files with 6 additions and 5 deletions

View file

@ -56,7 +56,7 @@ def get_endpoints_for_loadbalancers():
server_number = 1 server_number = 1
if 'addresses' in subset: if 'addresses' in subset:
for address in subset['addresses']: for address in subset['addresses']:
gateway_endpoint['servers'].append("server %s_%s %s:%d check cookie %s" % (service_name, server_number, address['ip'], port['targetPort']), server_number) gateway_endpoint['servers'].append("server %s_%s %s:%d cookie %s" % (service_name, server_number, address['ip'], port['targetPort']), server_number)
server_number += 1 server_number += 1
load_balanced_endpoints.append(gateway_endpoint) load_balanced_endpoints.append(gateway_endpoint)
return load_balanced_endpoints return load_balanced_endpoints

View file

@ -20,11 +20,12 @@ backend {{ backend.name }}
mode {{ backend.mode }} mode {{ backend.mode }}
balance {{ backend.balance }} balance {{ backend.balance }}
{% for key, value in backend.labels %} {% for key, value in backend.labels %}
option {{ value }} # {{ key }} {% if 'haproxy_backend_option_' in key %}
{% endfor % {{ value }}
cookie {{ backend.mode }} insert indirect nocache {% endif %}
{% endfor %}
{% for server in backend.servers -%} {% for server in backend.servers -%}
{{ server }} {{ server }}{% for key, value in backend.labels %}{% if 'haproxy_server_config_' in key %} {{ value }}{% endif %}{% endfor %}
{% endfor %} {% endfor %}
{% endfor %} {% endfor %}