apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: clamav
  labels:
    k8s-app: clamav-host-scanner
  namespace: clamav-scanner
spec:
  selector:
    matchLabels:
      name: clamav
  template:
    metadata:
      labels:
        name: clamav
    spec:
      nodeSelector: 
        node-role.kubernetes.io/worker: ""
      containers:
      - name: clamav-scanner
        image: image-registry.openshift-image-registry.svc:5000/clamav-scanner/clamav:1.0.0
        resources:
          limits:
            cpu: 1Gi
            memory: 3Gi
          requests:
            cpu: 500m
            memory: 2Gi
        securityContext:
          privileged: true
        volumeMounts:
        - name: data-vol
          mountPath: /data
        - name: host-fs
          mountPath: /host-fs
          readOnly: true
        - name: logs
          mountPath: /logs
        livenessProbe:
          exec:
            command:
              - /health.sh
          initialDelaySeconds: 60
          periodSeconds: 30
      terminationGracePeriodSeconds: 30
      volumes:
      - name: data-vol
        emptyDir: {}
      - name: host-fs
        hostPath:
          path: /var/lib/kubelet/pods
      - name: logs
        hostPath:
          path: /var/log/clamav
      serviceAccount: clamav-sa
      serviceAccountName: clamav-sa
