apiVersion: apps/v1
kind: Deployment
metadata:
  name: icloudpd
  namespace: photoprism
spec:
  replicas: 1
  selector:
    matchLabels:
      app: icloudpd
  template:
    metadata:
      labels:
        app: icloudpd
    spec:
      containers:
        - name: icloudpd
          image: r3d454/iclouddownloader:latest
#          image: r3d454/dockericloudpd:latest
          env:
            - name: apple_id
              value: "Henry-Winkel@web.de"
            - name: apple_password
              valueFrom:
                secretKeyRef:
                  name: icloudpd-secret
                  key: apple_password
            - name: download_path
              value: "/data/originals"
            - name: authentication_type
              value: "Web"
            - name: directory_permissions
              value: "777"
            - name: file_permissions
              value: "777"
            - name: set_exif_datetime
              value: "false"
            - name: auto_delete
              value: "False"
          volumeMounts:
            - name: icloudpd-storage
              mountPath: /data/
      volumes:
        - name: icloudpd-storage
          persistentVolumeClaim:
            claimName: photoprism-storage
---
apiVersion: v1
kind: Service
metadata:
  name: icloudpd-service
  namespace: photoprism
spec:
  selector:
    app: icloudpd
  ports:
    - protocol: TCP
      port: 8080
      targetPort: 8080
  type: NodePort
