apiVersion: v1
kind: ConfigMap
metadata:  
  name: envoy-service-api-jaeger-cm
  namespace: owlvey
data:
  envoy.yml: |
    admin:
      access_log_path: /tmp/admin_access.log
      address:
        socket_address:
          protocol: TCP
          address: 127.0.0.1
          port_value: 9901    
    static_resources:
      listeners:
      - name: listener_0
        address:
          socket_address:
            protocol: TCP
            address: 0.0.0.0
            port_value: 10000
        traffic_direction: OUTBOUND
        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
              generate_request_id: true
              tracing:
                provider:
                  name: envoy.tracers.zipkin
                  typed_config:
                    "@type": type.googleapis.com/envoy.config.trace.v2.ZipkinConfig
                    collector_cluster: jaeger
                    collector_endpoint: "/api/v2/spans"
                    shared_span_context: false
                    collector_endpoint_version: HTTP_JSON                    
              codec_type: auto
              access_log:
              - name: envoy.access_loggers.file
                typed_config: 
                  "@type": type.googleapis.com/envoy.config.accesslog.v2.FileAccessLog
                  path: "/tmp/access.log"
              stat_prefix: ingress_http
              route_config:
                name: local_route
                virtual_hosts:
                - name: local_service
                  domains: ["*"]
                  routes:
                  - match:
                      prefix: "/"
                    route:
                      cluster: service_owlvey_api
              http_filters:
              - name: envoy.filters.http.router
                typed_config: {}
      clusters:
      - name: jaeger
        connect_timeout: 1s
        type: strict_dns
        lb_policy: round_robin
        load_assignment:
          cluster_name: jaeger
          endpoints:
          - lb_endpoints:
            - endpoint:
                address:
                  socket_address:
                    address: jaeger-service.tracing.svc.cluster.local
                    port_value: 9411
      - name: service_owlvey_api
        connect_timeout: 1s
        type: strict_dns        
        lb_policy: round_robin
        load_assignment:
          cluster_name: local_service
          endpoints:
          - lb_endpoints:
            - endpoint:
                address:
                  socket_address:
                    address: service-api-backdoor.owlvey.svc.cluster.local
                    port_value: 48100
        