---
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: clamav
  namespace: kube-system
  labels:
    app: clamd
    dimension: control-plane
    role: scanning
spec:
  selector:
    matchLabels:
      name: clamav
  template:
    metadata:
      labels:
        name: clamav
    spec:
      containers:
      - name: clamd
        image: logindotgov/secops-clamav:master
        securityContext:
          privileged: true
          capabilities:
            add: ["SYS_ADMIN"]
        resources:
          limits:
            memory: 1.4Gi
          requests:
            cpu: 100m
            memory: 500Mi
        volumeMounts:
        - name: data-vol
          mountPath: /data
        - name: host-fs
          mountPath: /host-fs
          readOnly: true
        - name: logs
          mountPath: /logs
        livenessProbe:
          exec:
            command:
              - /health.sh
          initialDelaySeconds: 180
          periodSeconds: 30
      terminationGracePeriodSeconds: 30
      volumes:
      - name: data-vol
        emptyDir: {}
      - name: host-fs
        hostPath:
          path: /
      - name: logs
        hostPath:
          path: /var/log/clamav
