apiVersion: v1
kind: ConfigMap
metadata:
  name: tracing-config
  namespace: default
data:
  config.yaml: |
    static_resources:
      clusters:
      - name: zipkin
        connect_timeout: 5s
        type: strict_dns
        lb_policy: round_robin
        load_assignment:
          cluster_name: zipkin
          endpoints:
          - lb_endpoints:
            - endpoint:
                address:
                  socket_address:
                    address: wavefront-proxy.defult.svc.cluster.local
                    port_value: 9411
    tracing:
      http:
        name: envoy.zipkin
        config:
          collector_cluster: zipkin
          collector_endpoint: "/api/v1/spans"



# Configure Envoy sidecars to have the above configuration:
# Ex:
#      containers:
#        - name: colorteller
#          image: colorteller:latest
#          ports:
#            - containerPort: 9080
#          env:
#            - name: "SERVER_PORT"
#              value: "9080"
#            - name: "COLOR"
#              value: "red"
#        - name: envoy
#          image: 111345817488.dkr.ecr.us-west-2.amazonaws.com/aws-appmesh-envoy:v1.8.0.2-beta
#          securityContext:
#            runAsUser: 1337
#          env:
#            - name: "APPMESH_VIRTUAL_NODE_NAME"
#              value: "mesh/<meshName>/virtualNode/colorteller-black-vn"
#            - name: "ENVOY_LOG_LEVEL"
#              value: "debug"
#            - name: "AWS_REGION"
#              value: us-west-2
#            - name: "ENVOY_TRACING_CFG_FILE"
#              value: "/etc/zipkin/config.yaml"
#          volumeMounts:
#          - name: tracing-config
#            mountPath: /etc/zipkin/
#            readOnly: true
#      volumes:
#      - name: tracing-config
#        configMap:
#          name: tracing-config
