kind: ConfigMap
apiVersion: v1
metadata:
  name: envoy-config-servicebroker
data:
  envoy.yaml: |
    static_resources:
      listeners:
      - name: grpc_listener
        address:
          socket_address:
            address: 0.0.0.0
            port_value: 11110
        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
              stream_idle_timeout: 0s
              route_config:
                name: local_route
                virtual_hosts:
                - name: service_broker_grpc
                  domains:
                  - "*"
                  routes:
                  - match:
                      prefix: "/"
                      grpc: {}
                    route:
                      cluster: service_broker_grpc
              http_filters:
              - name: envoy.filters.http.router
                typed_config: {}
      - name: redis_listener
        address:
          socket_address:
            address: 0.0.0.0
            port_value: 1999
        filter_chains:
        - filters:
          - name: envoy.filters.network.redis_proxy
            typed_config:
              "@type": type.googleapis.com/envoy.config.filter.network.redis_proxy.v2.RedisProxy
              stat_prefix: egress_redis
              settings:
                op_timeout: 5s
              prefix_routes:
                catch_all_route:
                  cluster: redis_cluster
      clusters:
      - name: service_broker_grpc
        connect_timeout: 0.250s
        type: strict_dns
        lb_policy: round_robin
        http2_protocol_options: {}
        load_assignment:
          cluster_name: service_broker_grpc
          endpoints:
          - lb_endpoints:
            - endpoint:
                address:
                  socket_address:
                    address: 127.0.0.1
                    port_value: 11111
      - name: redis_cluster
        connect_timeout: 1s
        type: strict_dns # static
        lb_policy: MAGLEV
        load_assignment:
          cluster_name: redis_cluster
          endpoints:
          - lb_endpoints:
            - endpoint:
                address:
                  socket_address:
                    address: redis
                    port_value: 6379
    admin:
      access_log_path: /tmp/admin_access.log
      address:
        socket_address:
          address: 0.0.0.0
          port_value: 10001