diff --git a/gateway-haproxy-config.py b/gateway-haproxy-config.py index 46db381..2ccfad4 100644 --- a/gateway-haproxy-config.py +++ b/gateway-haproxy-config.py @@ -56,7 +56,7 @@ def get_endpoints_for_loadbalancers(): server_number = 1 if 'addresses' in subset: 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 load_balanced_endpoints.append(gateway_endpoint) return load_balanced_endpoints diff --git a/haproxy.j2 b/haproxy.j2 index c795ac2..898c8e0 100644 --- a/haproxy.j2 +++ b/haproxy.j2 @@ -20,11 +20,12 @@ backend {{ backend.name }} mode {{ backend.mode }} balance {{ backend.balance }} {% for key, value in backend.labels %} - option {{ value }} # {{ key }} - {% endfor % - cookie {{ backend.mode }} insert indirect nocache + {% if 'haproxy_backend_option_' in key %} + {{ value }} + {% endif %} + {% endfor %} {% for server in backend.servers -%} - {{ server }} + {{ server }}{% for key, value in backend.labels %}{% if 'haproxy_server_config_' in key %} {{ value }}{% endif %}{% endfor %} {% endfor %} {% endfor %}