apiVersion: apps/v1
kind: Deployment
metadata:
  name: zwave
spec:
  replicas: 1
  selector:
    matchLabels:
      name: zwave
  template:
    metadata:
      labels:
        name: zwave
    spec:
      containers:
        - name: zwave
          image: zwavejs/zwavejs2mqtt:latest
          livenessProbe:
            failureThreshold: 12
            httpGet:
              httpHeaders:
                - name: Accept
                  value: text/plain
              path: /health
              port: http
            initialDelaySeconds: 30
            periodSeconds: 10
            successThreshold: 1
            timeoutSeconds: 2
          ports:
            - containerPort: 8091
              name: http
              protocol: TCP
          resources:
            limits:
              cpu: '1'
              memory: 512Mi
            requests:
              cpu: '1'
              memory: 400Mi
          securityContext:
            allowPrivilegeEscalation: true
            privileged: true
          volumeMounts:
            - mountPath: /dev/ttyUSB1
              name: zwavestick
            - mountPath: /usr/src/app/store
              name: data
      volumes:
        # - name: config <-- if putting your settings.json in a secret
        #   secret:
        #     defaultMode: 420
        #     secretName: zwavejs2mqtt
        - name: zwavestick
          hostPath:
            path: /dev/ttyACM0
            type: File
        - name: data
          hostPath:
            path: /zwave/data
