123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- apiVersion: batch/v1
- kind: CronJob
- metadata:
- name: gdrive-backup
- spec:
- schedule: "@weekly"
- jobTemplate:
- spec:
- template:
- spec:
- restartPolicy: "Never"
- affinity:
- nodeAffinity:
- requiredDuringSchedulingIgnoredDuringExecution:
- nodeSelectorTerms:
- - matchExpressions:
- - key: kubernetes.io/arch
- operator: In
- values:
- - amd64
- 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
|