---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: jdownloader
spec:
  selector:
    matchLabels:
      app: jdownloader
  replicas: 1
  template:
    metadata:
      labels:
        app: jdownloader
    spec:
      containers:
        - env:
            - name: MYJD_DEVICE_NAME
              value: kubernetes
            - name: MYJD_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: myjd-creds
                  key: MYJD_PASSWORD
            - name: MYJD_USER
              valueFrom:
                secretKeyRef:
                  name: myjd-creds
                  key: MYJD_USER
            - name: TZ
              value: Europe/Zurich
            - name: XDG_DOWNLOAD_DIR
              value: /Downloads/jdownloader
          image: ghcr.io/tuxpeople/jdownloader-headless:pr-33
          imagePullPolicy: Always
          name: jdownloader
          resources:
            limits:
              cpu: 1000m
              memory: 1000Mi
          ports:
            - containerPort: 80
          volumeMounts:
            - mountPath: /Downloads
              name: downloads
            - mountPath: /opt/JDownloader/cfg
              name: jdownloader-config
      volumes:
        - name: downloads
          persistentVolumeClaim:
            claimName: nfs-media-downloads
        - name: jdownloader-config
          persistentVolumeClaim:
            claimName: jdownloader-config
