apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: pwrstatd
spec:
  selector:
    matchLabels:
      app: pwrstatd
  template:
    metadata:
      labels:
        app: pwrstatd
    spec:
      nodeSelector:
        ups: cyberpower
      containers:
      - name: pwrstatd
        command: ["/bin/sh", "/config/pwrstatd-entrypoint.sh"]
        image: gcr.io/urcomputeringpal/powerpanel-kubernetes
        securityContext:
          privileged: true
        volumeMounts:
        - mountPath: /dev/usb/hiddev0
          name: usb
        - name: config
          mountPath: /config
      volumes:
      - name: usb
        hostPath:
          path: /dev/usb/hiddev0
      - name: config
        configMap:
          name: pwrstatd
          defaultMode: 0755
