apiVersion: batch/v1
kind: CronJob
metadata:
  name: ntfy-ntfy-attachments-rclone
  labels:
    app.kubernetes.io/controller: main
    app.kubernetes.io/instance: ntfy
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: ntfy-attachments-rclone
    app.kubernetes.io/version: v1.74.1
    helm.sh/chart: rclone-ntfy-attachments-remote-0.11.5
  namespace: ntfy
spec:
  suspend: false
  concurrencyPolicy: Forbid
  startingDeadlineSeconds: 30
  timeZone: America/Chicago
  schedule: "0 1 * * *"
  successfulJobsHistoryLimit: 1
  failedJobsHistoryLimit: 1
  jobTemplate:
    spec:
      parallelism: 1
      backoffLimit: 3
      template:
        metadata:
          labels:
            app.kubernetes.io/controller: main
            app.kubernetes.io/instance: ntfy
            app.kubernetes.io/name: ntfy-attachments-rclone
        spec:
          enableServiceLinks: false
          serviceAccountName: ntfy-ntfy-attachments-rclone
          automountServiceAccountToken: false
          hostIPC: false
          hostNetwork: false
          hostPID: false
          dnsPolicy: ClusterFirst
          restartPolicy: Never
          containers:
            - args:
                - sync
                - src:ntfy-attachments
                - dest:ntfy-attachments
                - --s3-no-check-bucket
                - --rc
                - --rc-addr=0.0.0.0:5572
                - --rc-enable-metrics
                - --rc-no-auth
                - --verbose
              env:
                - name: RCLONE_S3_PROVIDER
                  value: Other
                - name: RCLONE_CONFIG_SRC_TYPE
                  value: s3
                - name: RCLONE_CONFIG_SRC_PROVIDER
                  value: Other
                - name: RCLONE_CONFIG_SRC_ENV_AUTH
                  value: "false"
                - name: RCLONE_CONFIG_SRC_ACCESS_KEY_ID
                  valueFrom:
                    secretKeyRef:
                      key: ACCESS_KEY_ID
                      name: ntfy-attachments-rclone-source-config
                - name: RCLONE_CONFIG_SRC_SECRET_ACCESS_KEY
                  valueFrom:
                    secretKeyRef:
                      key: ACCESS_SECRET_KEY
                      name: ntfy-attachments-rclone-source-config
                - name: RCLONE_CONFIG_SRC_REGION
                  valueFrom:
                    secretKeyRef:
                      key: ACCESS_REGION
                      name: ntfy-attachments-rclone-source-config
                - name: RCLONE_CONFIG_SRC_ENDPOINT
                  valueFrom:
                    secretKeyRef:
                      key: SRC_ENDPOINT
                      name: ntfy-attachments-rclone-source-config
                - name: RCLONE_CONFIG_SRC_FORCE_PATH_STYLE
                  value: "true"
                - name: RCLONE_CONFIG_DEST_TYPE
                  value: s3
                - name: RCLONE_CONFIG_DEST_PROVIDER
                  value: Other
                - name: RCLONE_CONFIG_DEST_ENV_AUTH
                  value: "false"
                - name: RCLONE_CONFIG_DEST_ACCESS_KEY_ID
                  valueFrom:
                    secretKeyRef:
                      key: ACCESS_KEY_ID
                      name: ntfy-attachments-rclone-destination-config
                - name: RCLONE_CONFIG_DEST_SECRET_ACCESS_KEY
                  valueFrom:
                    secretKeyRef:
                      key: ACCESS_SECRET_KEY
                      name: ntfy-attachments-rclone-destination-config
                - name: RCLONE_CONFIG_DEST_REGION
                  valueFrom:
                    secretKeyRef:
                      key: ACCESS_REGION
                      name: ntfy-attachments-rclone-destination-config
                - name: RCLONE_CONFIG_DEST_ENDPOINT
                  valueFrom:
                    secretKeyRef:
                      key: DEST_ENDPOINT
                      name: ntfy-attachments-rclone-destination-config
                - name: RCLONE_CONFIG_DEST_FORCE_PATH_STYLE
                  value: "true"
              image: rclone/rclone:1.74.2@sha256:9ce0d49b611d3781233e25334e9e23d7af01e5546da7087f90d55f034ef13637
              imagePullPolicy: IfNotPresent
              name: sync
