---
# Source: splunk-otel-collector/templates/daemonset.yaml
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: default-splunk-otel-collector-agent
  labels:
    app: splunk-otel-collector
    chart: splunk-otel-collector-0.29.1
    release: default
    heritage: Helm
spec:
  updateStrategy:
    type: RollingUpdate
  selector:
    matchLabels:
      app: splunk-otel-collector
      release: default
  template:
    metadata:
      labels:
        app: splunk-otel-collector
        release: default
      annotations:
        checksum/config: dd5614a25e90b798edc25999f13b1d3405412936bf45f66f9cd47902a98c0c00
    spec:
      hostNetwork: true
      dnsPolicy: ClusterFirstWithHostNet
      serviceAccountName: default-splunk-otel-collector
      tolerations:
        
        - effect: NoSchedule
          key: node-role.kubernetes.io/master
      containers:
      - name: otel-collector
        command:
        - /otelcol
        - --config=/conf/relay.yaml
        - --metrics-addr=0.0.0.0:8889
        ports:
        - name: otlp
          containerPort: 4317
          hostPort: 4317
          protocol: TCP
        - name: signalfx
          containerPort: 9943
          hostPort: 9943
          protocol: TCP
        image: quay.io/signalfx/splunk-otel-collector:0.29.0
        imagePullPolicy: IfNotPresent
        env:
          - 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_ACCESS_TOKEN
            valueFrom:
              secretKeyRef:
                name: splunk-otel-collector
                key: splunk_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
          name: hostfs
          readOnly: true
          mountPropagation: HostToContainer
      terminationGracePeriodSeconds: 600
      volumes:
      - name: hostfs
        hostPath:
          path: /
      - name: otel-configmap
        configMap:
          name: default-splunk-otel-collector-otel-agent
          items:
            - key: relay
              path: relay.yaml
