Merge "Add haproxy_backend_only flag to service template"
This commit is contained in:
commit
5d7da9df3b
@ -356,3 +356,16 @@ Here is an example that shows how to achieve the goal
|
||||
This will add two acl rules ``path_sub -i write`` and ``path_sub -i query`` to
|
||||
the front end and use the backend specified in the rule. If no backend is specified
|
||||
it will use a default ``haproxy_service_name`` backend.
|
||||
|
||||
If a frontend service directs to multiple backend services using ACLs, and a
|
||||
backend service does not require its own corresponding front-end, the
|
||||
`haproxy_backend_only` option can be specified:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
- service:
|
||||
haproxy_service_name: influxdb
|
||||
haproxy_backend_only: true # Directed by the 'influxdb-relay' service above
|
||||
haproxy_backend_nodes:
|
||||
- name: influxdb-service
|
||||
ip_addr: 10.100.10.10
|
||||
|
@ -29,6 +29,7 @@
|
||||
{% set vip_binds = item.service.haproxy_bind %}
|
||||
{% endif -%}
|
||||
|
||||
{% if not item.service.haproxy_backend_only | default(false) %}
|
||||
{% for vip_bind in vip_binds %}
|
||||
{% if item.service.haproxy_redirect_http_port is defined and item.service.haproxy_ssl %}
|
||||
{% if (loop.index == 1 or item.service.haproxy_ssl_all_vips | default(false) | bool) %}
|
||||
@ -78,6 +79,7 @@ frontend {{ item.service.haproxy_service_name }}-front-{{ loop.index }}
|
||||
mode {{ item.service.haproxy_balance_type }}
|
||||
default_backend {{ item.service.haproxy_service_name }}-back
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% set backend_options = item.service.haproxy_backend_options|default([]) %}
|
||||
{% set backend_arguments = item.service.haproxy_backend_arguments|default([]) %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user