apiVersion: apps/v1
kind: Deployment
metadata:
  name: find-worker002
  namespace: k3s-arm-demo
spec:
  selector:
    matchLabels:
      app: find-worker002
  replicas: 1
  template:
    metadata:
      labels:
        app: find-worker002
    spec:
      containers:
      - name: find-worker002
        image: mak3r/rpi-led:latest
        args: ["blink2.sh", "5"]
        securityContext:
          privileged: true
        volumeMounts:
          - mountPath: /dev/gpiomem
            name: gpio4
        lifecycle:
          preStop:
            exec:
              command: ["/usr/bin/touch", "./terminate"]
      nodeSelector:
        nodetype: "worker"
      restartPolicy: Always
      volumes:
      - name: gpio4
        hostPath:
          path: /dev/gpiomem
