---
# Source: splunk-otel-collector/templates/daemonset.yaml
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: default-splunk-otel-collector-agent
  labels:
    app.kubernetes.io/name: splunk-otel-collector
    helm.sh/chart: splunk-otel-collector-0.51.0
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/instance: default
    app.kubernetes.io/version: "0.51.0"
    app: splunk-otel-collector
    chart: splunk-otel-collector-0.51.0
    release: default
    heritage: Helm
spec:
  updateStrategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 1
  selector:
    matchLabels:
      app: splunk-otel-collector
      release: default
  template:
    metadata:
      labels:
        app: splunk-otel-collector
        release: default
      annotations:
        checksum/config: 28b448550b794f98c3bf690f7d3248c7bd9adce0526b45b943cee6fbaa5aa1d5
        kubectl.kubernetes.io/default-container: otel-collector
    spec:
      hostNetwork: true
      dnsPolicy: ClusterFirstWithHostNet
      serviceAccountName: default-splunk-otel-collector
      nodeSelector:
        kubernetes.io/os: linux
      tolerations:
        
        - effect: NoSchedule
          key: node-role.kubernetes.io/master
      containers:
      - name: otel-collector
        command:
        - /otelcol
        - --config=/conf/relay.yaml
        ports:
        - name: jaeger-grpc
          containerPort: 14250
          hostPort: 14250
          protocol: TCP
        - name: jaeger-thrift
          containerPort: 14268
          hostPort: 14268
          protocol: TCP
        - name: otlp
          containerPort: 4317
          hostPort: 4317
          protocol: TCP
        - name: otlp-http
          containerPort: 4318
          protocol: TCP
        - name: otlp-http-old
          containerPort: 55681
          protocol: TCP
        - name: sfx-forwarder
          containerPort: 9080
          hostPort: 9080
          protocol: TCP
        - name: signalfx
          containerPort: 9943
          hostPort: 9943
          protocol: TCP
        - name: zipkin
          containerPort: 9411
          hostPort: 9411
          protocol: TCP
        image: quay.io/signalfx/splunk-otel-collector:0.51.0
        imagePullPolicy: IfNotPresent
        env:
          - name: SPLUNK_MEMORY_TOTAL_MIB
            value: "500"
          - name: K8S_NODE_NAME
            valueFrom:
              fieldRef:
                fieldPath: spec.nodeName
          - name: K8S_NODE_IP
            valueFrom:
              fieldRef:
                apiVersion: v1
                fieldPath: status.hostIP
          - name: K8S_POD_IP
            valueFrom:
              fieldRef:
                apiVersion: v1
                fieldPath: status.podIP
          - name: K8S_POD_NAME
            valueFrom:
              fieldRef:
                fieldPath: metadata.name
          - name: K8S_POD_UID
            valueFrom:
              fieldRef:
                fieldPath: metadata.uid
          - name: K8S_NAMESPACE
            valueFrom:
              fieldRef:
                fieldPath: metadata.namespace
          - name: SPLUNK_OBSERVABILITY_ACCESS_TOKEN
            valueFrom:
              secretKeyRef:
                name: splunk-otel-collector
                key: splunk_observability_access_token
          # Env variables for host metrics receiver
          - 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

        readinessProbe:
          httpGet:
            path: /
            port: 13133
        livenessProbe:
          httpGet:
            path: /
            port: 13133
        resources:
          limits:
            cpu: 200m
            memory: 500Mi
        volumeMounts:
        - mountPath: /conf
          name: otel-configmap
        - mountPath: /hostfs/dev
          name: host-dev
          readOnly: true
        - mountPath: /hostfs/etc
          name: host-etc
          readOnly: true
        - mountPath: /hostfs/proc
          name: host-proc
          readOnly: true
        - mountPath: /hostfs/run/udev/data
          name: host-run-udev-data
          readOnly: true
        - mountPath: /hostfs/sys
          name: host-sys
          readOnly: true
        - mountPath: /hostfs/var/run/utmp
          name: host-var-run-utmp
          readOnly: true
      terminationGracePeriodSeconds: 600
      volumes:
      - name: host-dev
        hostPath:
          path: /dev
      - name: host-etc
        hostPath:
          path: /etc
      - name: host-proc
        hostPath:
          path: /proc
      - name: host-run-udev-data
        hostPath:
          path: /run/udev/data
      - name: host-sys
        hostPath:
          path: /sys
      - name: host-var-run-utmp
        hostPath:
          path: /var/run/utmp
      - name: otel-configmap
        configMap:
          name: default-splunk-otel-collector-otel-agent
          items:
            - key: relay
              path: relay.yaml
