static_resources:
  listeners:
  - address:
      socket_address:
        address: 0.0.0.0
        port_value: 9090
    filter_chains:
    - filters:
      - name: envoy.filters.network.thrift_proxy
        typed_config:
          "@type": type.googleapis.com/envoy.extensions.filters.network.thrift_proxy.v3.ThriftProxy
          stat_prefix: ingress_thrift
          route_config:
            name: local_route
            routes:
            - match:
                method_name: ""
              route:
                cluster: versioned-cluster
          thrift_filters:
          - name: envoy.filters.thrift.payload_to_metadata
            typed_config:
              "@type": type.googleapis.com/envoy.extensions.filters.network.thrift_proxy.filters.payload_to_metadata.v3.PayloadToMetadata
              request_rules:
              - method_name: foo
                field_selector:
                  name: info
                  id: 2
                  child:
                    name: version
                    id: 1
                on_present:
                  metadata_namespace: envoy.lb
                  key: version
                on_missing:
                  metadata_namespace: envoy.lb
                  key: default
                  value: 'unknown'
  clusters:
  - name: versioned-cluster
    type: STRICT_DNS
    lb_policy: ROUND_ROBIN
    lb_subset_config:
      fallback_policy: NO_FALLBACK
      subset_selectors:
      - keys:
        - default
      - keys:
        - version
    load_assignment:
      cluster_name: versioned-cluster
      endpoints:
      - lb_endpoints:
        - endpoint:
            address:
              socket_address:
                address: 127.0.0.1
                port_value: 19090
          metadata:
            filter_metadata:
              envoy.lb:
                default: "true"
      - lb_endpoints:
        - endpoint:
            address:
              socket_address:
                address: 127.0.0.1
                port_value: 19091
          metadata:
            filter_metadata:
              envoy.lb:
                version: "1.0"
