---
# Source: opentelemetry-collector/templates/daemonset.yaml
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: example-opentelemetry-collector-agent
  labels:
    helm.sh/chart: opentelemetry-collector-0.15.1
    app.kubernetes.io/name: opentelemetry-collector
    app.kubernetes.io/instance: example
    app.kubernetes.io/version: "0.49.0"
    app.kubernetes.io/managed-by: Helm
spec:
  selector:
    matchLabels:
      app.kubernetes.io/name: opentelemetry-collector
      app.kubernetes.io/instance: example
      component: agent-collector
  template:
    metadata:
      annotations:
        checksum/config: 7e46c6b643c0e5cf1c1db7cf8322fdbfde41f83f50f9a07260cc9b814996cde0
        
      labels:
        app.kubernetes.io/name: opentelemetry-collector
        app.kubernetes.io/instance: example
        component: agent-collector
        
    spec:
      
      serviceAccountName: example-opentelemetry-collector
      securityContext:
        {}
      containers:
        - name: opentelemetry-collector
          command:
            - /otelcol-contrib
            - --config=/conf/relay.yaml
          securityContext:
            {}
          image: "otel/opentelemetry-collector-contrib:0.49.0"
          imagePullPolicy: IfNotPresent
          ports:
            - name: jaeger-compact
              containerPort: 6831
              protocol: UDP
              hostPort: 6831
            - name: jaeger-grpc
              containerPort: 14250
              protocol: TCP
              hostPort: 14250
            - name: jaeger-thrift
              containerPort: 14268
              protocol: TCP
              hostPort: 14268
            - name: otlp
              containerPort: 4317
              protocol: TCP
              hostPort: 4317
            - name: otlp-http
              containerPort: 4318
              protocol: TCP
              hostPort: 4318
            - name: zipkin
              containerPort: 9411
              protocol: TCP
              hostPort: 9411
          env:
            - name: MY_POD_IP
              valueFrom:
                fieldRef:
                  apiVersion: v1
                  fieldPath: status.podIP
            - name: HOST_PROC
              value: /hostfs/proc
            - name: HOST_SYS
              value: /hostfs/sys
            - name: HOST_ETC
              value: /hostfs/etc
            - name: HOST_VAR
              value: /hostfs/var
            - name: HOST_RUN
              value: /hostfs/run
            - name: HOST_DEV
              value: /hostfs/dev
          livenessProbe:
            httpGet:
              path: /
              port: 13133
          readinessProbe:
            httpGet:
              path: /
              port: 13133
          resources:
            limits:
              cpu: 1
              memory: 2Gi
          volumeMounts:
            - mountPath: /conf
              name: opentelemetry-collector-configmap
            - name: hostfs
              mountPath: /hostfs
              readOnly: true
              mountPropagation: HostToContainer
      volumes:
        - name: opentelemetry-collector-configmap
          configMap:
            name: example-opentelemetry-collector-agent
            items:
              - key: relay
                path: relay.yaml
        - name: hostfs
          hostPath:
            path: /
      hostNetwork: false
