static_resources:
  listeners:
  - address:
      socket_address:
        address: 0.0.0.0
        port_value: 80 
    traffic_direction: OUTBOUND
    filter_chains: 
    - filters:
      - name: envoy.filters.network.http_connection_manager
        typed_config:
          "@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
          generate_request_id: true
          tracing:
            provider:
              name: envoy.tracers.zipkin
              typed_config:
                "@type": type.googleapis.com/envoy.config.trace.v3.ZipkinConfig
                collector_cluster: zipkin
                collector_endpoint: "/api/v2/spans"
                collector_endpoint_version: HTTP_JSON
          codec_type: AUTO
          stat_prefix: ingress_http
          route_config:
            name: local_route
            virtual_hosts:
            - name: backend
              domains:
              - "*"
              routes:
              - match:
                  prefix: "/"
                route:
                  cluster: accounts-nominee 
                  timeout: 300s
                decorator:
                  operation: rest_of_all
              response_headers_to_add:
              - header:
                  key: "x-b3-traceid"
                  value: "%REQ(x-b3-traceid)%"
              - header:
                  key: "x-request-id"
                  value: "%REQ(x-request-id)%"
          http_filters:
          - name: envoy.filters.http.router
  - address:
      socket_address:
        address: 0.0.0.0
        port_value: 9012
    traffic_direction: OUTBOUND
    filter_chains:
    - filters:
      - name: envoy.filters.network.tcp_proxy
        typed_config:
          "@type": type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
          cluster: dl-accounts-rmq
          stat_prefix: egress_tcp
          
  clusters:
  - name: accounts-nominee 
    connect_timeout: 30s
    type: STRICT_DNS
    lb_policy: ROUND_ROBIN
    load_assignment:
      cluster_name: accounts-misc-apis
      endpoints:
      - lb_endpoints:
        - endpoint:
            address: 
              socket_address:
                address: 127.0.0.1
                port_value: 8080
  - name: dl-accounts-rmq
    connect_timeout: 30s
    type: STRICT_DNS
    lb_policy: ROUND_ROBIN
    load_assignment: 
      cluster_name: dl-accounts-rmq
      endpoints:
        - lb_endpoints:
          - endpoint:  {address: {socket_address: { protocol: TCP, address: 172.20.4.199, port_value: 5672 }}}
          - endpoint:  {address: {socket_address: { protocol: TCP, address: 172.20.4.62, port_value: 5672 }}}
          - endpoint:  {address: {socket_address: { protocol: TCP, address: 172.20.4.81, port_value: 5672 }}}
  - name: zipkin
    connect_timeout: 1s
    type: STRICT_DNS
    lb_policy: ROUND_ROBIN
    load_assignment:
      cluster_name: zipkin
      endpoints:
      - lb_endpoints:
        - endpoint:
            address:
              socket_address:
                address: zipkin
                port_value: 9411
