apiVersion: apps/v1
kind: DaemonSet
metadata:
  labels:
    app.kubernetes.io/component: observability
    app.kubernetes.io/instance: parca-agent
    app.kubernetes.io/name: parca-agent
    app.kubernetes.io/version: dev
  name: parca-agent
  namespace: parca
spec:
  selector:
    matchLabels:
      app.kubernetes.io/component: observability
      app.kubernetes.io/instance: parca-agent
      app.kubernetes.io/name: parca-agent
  template:
    metadata:
      labels:
        app.kubernetes.io/component: observability
        app.kubernetes.io/instance: parca-agent
        app.kubernetes.io/name: parca-agent
        app.kubernetes.io/version: dev
    spec:
      containers:
      - args:
        - /bin/parca-agent
        - --log-level=debug
        - --node=$(NODE_NAME)
        - --kubernetes
        - --store-address=parca.parca.svc.cluster.local:7070
        - --insecure
        - --insecure-skip-verify
        - --temp-dir=tmp
        env:
        - name: NODE_NAME
          valueFrom:
            fieldRef:
              fieldPath: spec.nodeName
        image: parca.io/parca/parca-agent:dev
        name: parca-agent
        securityContext:
          privileged: true
        volumeMounts:
        - mountPath: /host/root
          name: root
          readOnly: true
        - mountPath: /host/proc
          name: proc
          readOnly: true
        - mountPath: /run
          name: run
        - mountPath: /lib/modules
          name: modules
        - mountPath: /sys/kernel/debug
          name: debugfs
        - mountPath: /sys/fs/cgroup
          name: cgroup
        - mountPath: /sys/fs/bpf
          name: bpffs
        - mountPath: /etc/localtime
          name: localtime
      hostPID: true
      serviceAccountName: parca-agent
      tolerations:
      - effect: NoSchedule
        operator: Exists
      - effect: NoExecute
        operator: Exists
      volumes:
      - hostPath:
          path: /
        name: root
      - hostPath:
          path: /proc
        name: proc
      - hostPath:
          path: /run
        name: run
      - hostPath:
          path: /sys/fs/cgroup
        name: cgroup
      - hostPath:
          path: /lib/modules
        name: modules
      - hostPath:
          path: /sys/fs/bpf
        name: bpffs
      - hostPath:
          path: /sys/kernel/debug
        name: debugfs
      - hostPath:
          path: /etc/localtime
        name: localtime
