apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: intel-vpu-hddl
  namespace: kube-system
  labels:
    app: intel-vpu-hddl
spec:
  selector:
    matchLabels:
      app: intel-vpu-hddl
  template:
    metadata:
      labels:
        app: intel-vpu-hddl
    spec:
      containers:
      - name: intel-vpu-hddl
        image: docker
        command: ["/bin/sh"]
# run "init" image with privileged and this will quit soon
# run "hddl" image with non-privileged
        args: ["-c", "docker stop ov_hddl;/usr/local/bin/docker run --rm --privileged -v /usr/src:/usr/src -v /lib/modules:/lib/modules -v /etc/modules-load.d:/etc/modules-load.d openvisualcloud/vcaca-ubuntu1804-analytics-hddldaemon:20.4 /usr/local/bin/init_hddl.sh; /usr/local/bin/docker run --name ov_hddl --rm --device-cgroup-rule='c 10:* rmw' --device-cgroup-rule='c 89:* rmw' --device-cgroup-rule='c 189:* rmw' --device-cgroup-rule='c 180:* rmw' -v /dev:/dev -v /var/tmp:/var/tmp openvisualcloud/vcaca-ubuntu1804-analytics-hddldaemon:20.4 /usr/local/bin/run_hddl.sh"]
        imagePullPolicy: IfNotPresent
        securityContext:
          readOnlyRootFilesystem: false
          privileged: true
        volumeMounts:
            - name: dockersock
              mountPath: /var/run/docker.sock
            - name: usrsrc
              mountPath: /usr/src
              readOnly: true
            - name: libmodules
              mountPath: /lib/modules
            - name: etcmodules
              mountPath: /etc/modules-load.d
            - name: vartmp
              mountPath: /var/tmp
      volumes:
          - name: dockersock
            hostPath:
                path: /var/run/docker.sock
          - name: usrsrc
            hostPath:
                path: /usr/src
          - name: libmodules
            hostPath:
                path: /lib/modules
          - name: etcmodules
            hostPath:
                path: /etc/modules-load.d
          - name: vartmp
            hostPath:
                path: /var/tmp
      nodeSelector:
          vcac-zone: "yes"
