apiVersion: apps/v1
kind: Deployment
metadata:
  name: tesla-dashcam
  namespace: default
  labels:
    app.kubernetes.io/instance: tesla-dashcam
    app.kubernetes.io/name: tesla-dashcam
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/instance: tesla-dashcam
      app.kubernetes.io/name: tesla-dashcam
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: tesla-dashcam
        app.kubernetes.io/name: tesla-dashcam
    spec:
      containers:
      - name: tesla-dashcam
        env:
        - name: TZ
          value: America/New_York
        # image: billimek/tesla_dashcam:0.1.20
        image: billimek/tesla_dashcam:0.1.20-intel-vaapi
        imagePullPolicy: Always
        # args: ["--delete_source", "--gpu", "--gpu_type", "vaapi", "--skip_existing", "--monitor", "--monitor_trigger", "/input/SentryClips/ARCHIVE_UPLOADED", "--motion_only", "--output", "/output", "/input/SentryClips", "/input/SavedClips"]
        args: ["--delete_source", "--skip_existing", "--monitor", "--monitor_trigger", "/input/SentryClips/ARCHIVE_UPLOADED", "--motion_only", "--output", "/output", "/input/SentryClips", "/input/SavedClips"]
        # resources:
        #   limits:
        #     gpu.intel.com/i915: 1
        volumeMounts:
        - mountPath: /input
          name: media
          subPath: Videos/Tesla/
        - mountPath: /output
          name: media
          subPath: Videos/tesla_dashcam/
      securityContext:
        fsGroup: 1001
        runAsGroup: 1001
        runAsUser: 1001
      volumes:
      - name: media
        persistentVolumeClaim:
          claimName: nfs-media-pvc
