apiVersion: v1
kind: ConfigMap
metadata:
  name: canary-patch-envoy-config
data:
  envoy-config.yaml: |-
    admin:
      address:
        socket_address:
          address: 0.0.0.0
          port_value: 9090
    static_resources:
      listeners:
      - name: ingress
        address:
          socket_address:
            address: 0.0.0.0
            port_value: 9095
        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
              access_log:
              - name: envoy.access_loggers.stdout
                typed_config:
                  "@type": type.googleapis.com/envoy.extensions.access_loggers.stream.v3.StdoutAccessLog
              http_filters:
              - name: envoy.filters.http.router
              route_config:
                name: local_route
                virtual_hosts:
                - name: envoy
                  domains:
                    - '*'
                  routes:
                    - match:
                        prefix: /
                      route:
                        weighted_clusters:
                          clusters:
                            - name: primary-cluster
                              weight: 100
                            - name: canary-cluster
                              weight: 0
      clusters:
      - name: primary-cluster
        connect_timeout: 0.25s
        type: STRICT_DNS
        lb_policy: ROUND_ROBIN
        load_assignment:
          cluster_name: primary-cluster
          endpoints:
          - lb_endpoints:
            - endpoint:
                address:
                  socket_address:
                    address: canary-patch
                    port_value: 9085
        track_cluster_stats:
          request_response_sizes: true
      - name: canary-cluster
        connect_timeout: 0.25s
        type: STRICT_DNS
        lb_policy: ROUND_ROBIN
        load_assignment:
          cluster_name: canary-cluster
          endpoints:
          - lb_endpoints:
            - endpoint:
                address:
                  socket_address:
                    address: canary-patch-canary
                    port_value: 9085
        track_cluster_stats:
          request_response_sizes: true
