apiVersion: batch/v1 kind: CronJob metadata: name: gdrive-backup spec: schedule: "@weekly" jobTemplate: spec: template: spec: restartPolicy: "Never" affinity: nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - key: arch operator: In values: - x86 initContainers: - name: prepare-gdrive-credentials image: busybox command: ['sh', '-c', 'cp -R /credentials/* /root/.config/gdrive3'] volumeMounts: - name: credentials mountPath: "/credentials/victor.lavaud@gmail.com" subPath: "victor.lavaud@gmail.com" - name: accounts mountPath: "/credentials/accounts.json" subPath: "accounts.json" - name: gdrive-config mountPath: "/root/.config/gdrive3" containers: - name: gdrive-backup image: qdii/backup-gdrive:latest imagePullPolicy: "Always" env: - name: LOCAL_FOLDER_PATH value: "/tmp/app" - name: REMOTE_USER value: "uab10c1ba4bc" - name: REMOTE_SERVER value: "bck.dodges.it" - name: REMOTE_FOLDER_PATH value: "/home/uab10c1ba4bc/data/vol0/gdrive" - name: ACCOUNT value: "victor.lavaud@gmail.com" volumeMounts: - name: ephemeral mountPath: "/tmp/app" - name: gdrive-config mountPath: "/root/.config/gdrive3" - name: backup mountPath: "/root/.ssh/id_rsa" subPath: ssh_private_key - name: backup mountPath: "/root/.ssh/id_rsa.pub" subPath: ssh_public_key volumes: - name: credentials projected: sources: - secret: name: gdrive items: - key: secret.json path: "victor.lavaud@gmail.com/secret.json" - key: tokens.json path: "victor.lavaud@gmail.com/tokens.json" - name: accounts secret: secretName: gdrive items: - key: accounts.json path: "accounts.json" - name: backup secret: secretName: backup defaultMode: 0400 - name: ephemeral emptyDir: sizeLimit: 50Gi - name: gdrive-config emptyDir: sizeLimit: 10Mi