apiVersion: v1
data:
  envoy.yaml: |
    static_resources:
      listeners:
        - address:
            socket_address:
              protocol: TCP
              address: 0.0.0.0
              port_value: 9211
          filter_chains:
            - filters:
                name: envoy.filters.network.http_connection_manager
                typed_config:
                  "@type": type.googleapis.com/envoy.config.filter.network.http_connection_manager.v2.HttpConnectionManager
                  codec_type: auto
                  stat_prefix: ingress_http
                  route_config:
                    name: local_service_route
                    virtual_hosts:
                      - name: local_service_route
                        domains:
                          - "*"
                        routes:
                          - match:
                              prefix: "/"
                            route:
                              cluster: local_service
                  http_filters:
                    - name: envoy.filters.http.router
        - address:
            socket_address:
              protocol: TCP
              address: 127.0.0.1
              port_value: 9001
          filter_chains:
            - filters:
                name: envoy.filters.network.http_connection_manager
                typed_config:
                  "@type": type.googleapis.com/envoy.config.filter.network.http_connection_manager.v2.HttpConnectionManager
                  codec_type: auto
                  stat_prefix: egress_http
                  route_config:
                    name: egress_route
                    virtual_hosts:
                      - name: egress_route
                        domains:
                          - "*"
                        routes:
                          - match:
                              prefix: "/"
                            route:
                              cluster: proxy_cluster
                  http_filters:
                    - name: envoy.filters.http.dynamic_forward_proxy
                      typed_config:
                        "@type": type.googleapis.com/envoy.config.filter.http.dynamic_forward_proxy.v2alpha.FilterConfig
                        dns_cache_config:
                          name: proxy_dns_cache
                          dns_lookup_family: V4_ONLY
                    - name: envoy.filters.http.router
      clusters:
        - name: local_service
          connect_timeout: 1s
          type: static
          lb_policy: round_robin
          load_assignment:
            cluster_name: local_service
            endpoints:
              - lb_endpoints:
                - endpoint:
                    address:
                      socket_address:
                        address: 127.0.0.1
                        port_value: 8080
        - name: proxy_cluster
          connect_timeout: 1s
          lb_policy: CLUSTER_PROVIDED
          cluster_type:
            name: envoy.clusters.dynamic_forward_proxy
            typed_config:
              "@type": type.googleapis.com/envoy.config.cluster.dynamic_forward_proxy.v2alpha.ClusterConfig
              dns_cache_config:
                name: proxy_dns_cache
                dns_lookup_family: V4_ONLY
    admin:
      access_log_path: "/dev/null"
      address:
        socket_address:
          address: 0.0.0.0
          port_value: 8001
kind: ConfigMap
metadata:
  name: envoy-config
