apiVersion: apps/v1
kind: DaemonSet
metadata:
  labels:
    k8s-app: kindling-agent
  name: kindling-agent
  namespace: kindling
spec:
  selector:
    matchLabels:
      k8s-app: kindling-agent
  template:
    metadata:
      labels:
        k8s-app: kindling-agent
    spec:
      serviceAccount: kindling-agent
      containers:
      - name: kindling-probe
        image: kindlingproject/kindling-probe:latest
        imagePullPolicy: Always
        lifecycle:
          postStart:
            exec:
              command:
                - sh
                - /pl/post_start.sh
        args:
        - --v=1
        - --minloglevel=0
        - --log_dir=/pl
        - --logtostderr=false
        - --stirling_enable_kafka_tracing=false
        - --stirling_enable_nats_tracing=false
        - --stirling_enable_redis_tracing=false
        - --stirling_enable_dns_tracing=false
        - --stirling_enable_cass_tracing=false
        - --stirling_enable_http_tracing=false
        - --stirling_enable_pgsql_tracing=false
        - --stirling_enable_mysql_tracing=false
        command:
        - /pl/docker-entrypoint.sh
        resources:
          limits:
            memory: 300Mi
          requests:
            memory: 300Mi
        env:
        - name: HOST_PROC
          value: /host/proc
        - name: PL_HOST_PATH
          value: /host
        - name: SYSDIG_HOST_ROOT
          value: /host
        securityContext:
          privileged: true
        readinessProbe:
          exec:
            command:
            - cat
            - /opt/kernel-support
          initialDelaySeconds: 5
          periodSeconds: 5
        volumeMounts:
        - name: shared-volume-kindling
          mountPath: /home/kindling
          readOnly: false
        - name: shared-volume-subpub
          mountPath: /home/kindling-sub
        - mountPath: /sys
          name: sys-vol
        - mountPath: /etc/modprobe.d
          name: modprobe-d
          readOnly: true
        - mountPath: /host/dev
          name: dev-vol
        - mountPath: /host/proc
          name: proc-vol
          readOnly: true
        - mountPath: /host/etc
          name: etc-vol
          readOnly: true
        - mountPath: /host/boot
          name: boot-vol
          readOnly: true
        - mountPath: /host/lib/modules
          name: modules-vol
          readOnly: true
        - mountPath: /host/usr
          name: usr-vol
          readOnly: true
        - mountPath: /host/run
          name: run-vol
        - mountPath: /host/var/run
          name: varrun-vol
        - mountPath: /dev/shm
          name: dshm
      - name: kindling-collector
        image: kindlingproject/kindling-collector:latest
        imagePullPolicy: Always
        securityContext:
          privileged: true
        resources:
          limits:
            memory: 800Mi
          requests:
            memory: 300Mi
        env:
        - name: GOGC
          value: "400"
        - name: MY_NODE_IP
          valueFrom:
            fieldRef:
              fieldPath: status.hostIP
        - name: MY_NODE_NAME
          valueFrom:
            fieldRef:
              fieldPath: spec.nodeName
        volumeMounts:
        - mountPath: /etc/kindling/config
          name: kindlingcfg
        - name: shared-volume-kindling
          mountPath: /home/kindling
          readOnly: false
        - name: shared-volume-subpub
          mountPath: /home/kindling-sub
          readOnly: false
      dnsPolicy: ClusterFirstWithHostNet
      hostNetwork: true
      hostPID: true
      restartPolicy: Always
      schedulerName: default-scheduler
      terminationGracePeriodSeconds: 30
      volumes:
      - configMap:
          defaultMode: 420
          name: kindlingcfg
        name: kindlingcfg
      - hostPath:
          path: /etc/modprobe.d
        name: modprobe-d
      - hostPath:
          path: /etc/os-release
          type: FileOrCreate
        name: osrel
      - emptyDir:
          medium: Memory
        name: dshm
      - hostPath:
          path: /dev
        name: dev-vol
      - hostPath:
          path: /proc
        name: proc-vol
      - hostPath:
          path: /etc
        name: etc-vol
      - hostPath:
          path: /boot
        name: boot-vol
      - hostPath:
          path: /lib/modules
        name: modules-vol
      - hostPath:
          path: /usr
        name: usr-vol
      - hostPath:
          path: /run
        name: run-vol
      - hostPath:
          path: /var/run
        name: varrun-vol
      - hostPath:
          path: /sys
        name: sys-vol
      - name: shared-volume-kindling
        emptyDir: {}
      - name: shared-volume-subpub
        emptyDir: {}
