apiVersion: v1
kind: ConfigMap
metadata:
  name: client-sidecar-envoy
data:
  envoy.yaml: |
    admin:
      access_log_path: /tmp/admin_access.log
      address:
        socket_address: { address: 0.0.0.0, port_value: 8001 }
    static_resources:
      listeners:
        - name: listener_grpc
          address:
            socket_address: { address: 0.0.0.0, port_value: 9001 }
          filter_chains:
            - filters:
                name: envoy.http_connection_manager
                config:
                  stat_prefix: egress_http
                  codec_type: AUTO
                  route_config:
                    name: local_route
                    virtual_hosts:
                      - name: grpc-server
                        domains: ["*"]
                        routes:
                          - match: { prefix: "/" }
                            route: { cluster: grpc_server }
                  http_filters:
                    - name: envoy.router
      clusters:
        - name: grpc_server
          connect_timeout: 0.25s
          type: STRICT_DNS
          lb_policy: ROUND_ROBIN
          http2_protocol_options: {}
          load_assignment:
            cluster_name: grpc_server
            endpoints:
              lb_endpoints:
                - endpoint:
                    address:
                      socket_address:
                        address: grpc-server-service
                        port_value: 5001
