static_resources:
  listeners:
  - address:
      socket_address:
        address: 0.0.0.0
        port_value: 80
    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
          codec_type: AUTO
          stat_prefix: ingress_http
          route_config:
            name: local_route
            virtual_hosts:
            - name: app
              domains:
              - "*"
              routes:
              - match:
                  prefix: "/"
                route:
                  cluster: versioned-cluster
          http_filters:
          - name: envoy.filters.http.thrift_to_metadata
            typed_config:
              "@type": type.googleapis.com/envoy.extensions.filters.http.thrift_to_metadata.v3.ThriftToMetadata
              request_rules:
              - field: PROTOCOL
                on_present:
                  metadata_namespace: envoy.lb
                  key: protocol
                on_missing:
                  metadata_namespace: envoy.lb
                  key: protocol
                  value: "unknown"
              - field: TRANSPORT
                on_present:
                  metadata_namespace: envoy.lb
                  key: transport
                on_missing:
                  metadata_namespace: envoy.lb
                  key: transport
                  value: "unknown"
              response_rules:
              - field: MESSAGE_TYPE
                on_present:
                  metadata_namespace: envoy.filters.http.thrift_to_metadata
                  key: response_message_type
                on_missing:
                  metadata_namespace: envoy.filters.http.thrift_to_metadata
                  key: response_message_type
                  value: "exception"
              - field: REPLY_TYPE
                on_present:
                  metadata_namespace: envoy.filters.http.thrift_to_metadata
                  key: response_reply_type
                on_missing:
                  metadata_namespace: envoy.filters.http.thrift_to_metadata
                  key: response_reply_type
                  value: "error"
          - name: envoy.filters.http.router
            typed_config:
              "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router

  clusters:
  - name: versioned-cluster
    type: STRICT_DNS
    lb_policy: ROUND_ROBIN
    lb_subset_config:
      fallback_policy: ANY_ENDPOINT
      subset_selectors:
      - keys:
        - protocol
        - transport
    load_assignment:
      cluster_name: versioned-cluster
      endpoints:
      - lb_endpoints:
        - endpoint:
            address:
              socket_address:
                address: 127.0.0.1
                port_value: 8080
          metadata:
            filter_metadata:
              envoy.lb:
                default: "true"
      - lb_endpoints:
        - endpoint:
            address:
              socket_address:
                address: 127.0.0.1
                port_value: 8081
          metadata:
            filter_metadata:
              envoy.lb:
                version: "1.0"
