{%- set region = discovery_request.node.locality.zone -%} {%- set partition = discovery_request.node.cluster -%} {%- set is_bitbucket = "bitbucket" in partition -%} {% macro tls_transport_socket() %} name: envoy.transport_sockets.tls '@type': type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.UpstreamTlsContext typed_config: common_tls_context: {} max_session_keys: 0 {% endmacro %} {# Healthcheck cluster #} - name: loopback_default type: STATIC connect_timeout: 5s {%- if is_bitbucket %} transport_socket: name: envoy.transport_sockets.upstream_proxy_protocol @type: type.googleapis.com/envoy.extensions.transport_sockets.proxy_protocol.v3.ProxyProtocolUpstreamTransport typed_config: config {version: V2 transport_socket: {{ tls_transport_socket()|indent(6) }} {%- else %} transport_socket: {{ tls_transport_socket()|indent(4) }} {%- endif %} load_assignment: cluster_name: loopback_default endpoints: - lb_endpoints: - endpoint: address: socket_address: address: 127.0.0.1 port_value: 443 - test: {{ httpbin_response.headers.Foo }} {%- for instance in instances %} - cluster_name: {{ instance.parameters.service_name }}_{{ instance.parameters.resource_name }} hosts: {%- for host in instance.parameters.upstream_address %} - address: {{ host.address }} port: {{ host.port|default(443) }} {%- endfor %} {%- endfor %}