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: 1000
        fsGroup: 1002
      containers:
      - name: watcher
        image: carolynvs/handbrk8s-watcher:latest
        imagePullPolicy: Always
        args:
        - "--plex-server"
        - "https://192.168.0.103:32400"
        - "--shared-volume"
        - "/ponyshare/handbrk8s"
        envFrom:
        - secretRef:
            name: plex-secret
        volumeMounts:
        - mountPath: /ponyshare
          name: ponyshare
        - mountPath: /config/templates
          name: job-templates
      volumes:
      - name: ponyshare
        persistentVolumeClaim:
          claimName: ponyshare
      - name: job-templates
        configMap:
          name: job-templates
