apiVersion: apps/v1
kind: Deployment
metadata:
  name: watcher
  namespace: handbrk8s
spec:
  replicas: 1
  selector:
    matchLabels:
      app: watcher
  template:
    metadata:
      labels:
        app: watcher
    spec:
      securityContext: # hack because we mount a host volume, once we have polling, we should remove this
        runAsUser: 999
        fsGroup: 998
      containers:
      - name: watcher
        image: akolk/handbrk8s-watcher:latest
        imagePullPolicy: Always
        args:
        - "--plex-server"
        - "http://plex2.kolk.local:32400"
        env:
        - name: PLEX_TOKEN
          value: "Bpfj5wDaJGqcTBqDT8wJ"
        volumeMounts:
        - mountPath: /watch
          name: handbrk8s
        - mountPath: /work
          name: handbrk8s
        - mountPath: /config/templates
          name: job-templates
      nodeSelector:
        ponyshare: ""
      volumes:
      - name: handbrk8s
        hostPath:
          path: /ponyshare/handbrk8s
      - name: job-templates
        configMap:
          name: job-templates
