proper backup config
This commit is contained in:
		
							
								
								
									
										60
									
								
								infrastructure/backup/cronjobs-base/cronjob.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										60
									
								
								infrastructure/backup/cronjobs-base/cronjob.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,60 @@ | ||||
| apiVersion: batch/v1 | ||||
| kind: CronJob | ||||
| metadata: | ||||
|   name: restic-rclone-gdrive | ||||
|    | ||||
| spec: | ||||
|   successfulJobsHistoryLimit: 2 | ||||
|   failedJobsHistoryLimit: 2 | ||||
|  | ||||
|   jobTemplate: | ||||
|     spec: | ||||
|       template: | ||||
|         spec: | ||||
|           restartPolicy: Never | ||||
|           hostname: restic-k3s-pod | ||||
|           # used by restic to identify the host | ||||
|           containers: | ||||
|           # run after completion of initContainers | ||||
|           - name: ntfy-command-send | ||||
|             image: curlimages/curl | ||||
|             command: | ||||
|               - /bin/sh | ||||
|               - -c | ||||
|             args: | ||||
|               - >- | ||||
|                 curl | ||||
|                 https://ntfy.kluster.moll.re/backup | ||||
|                 -H "Title: ${OPERATION}" | ||||
|                 -d "Finished successfully" | ||||
|             env: | ||||
|               - name: OPERATION | ||||
|                 value: "PLACEHOLDER" | ||||
|  | ||||
|           initContainers: | ||||
|           - name: restic-base-container | ||||
|             image: restic/restic:latest | ||||
|             command: | ||||
|               - /bin/sh | ||||
|               - -c | ||||
|             # >- strips newlines | ||||
|             # RESTIC_ARGS Can be for instance: --verbose --dry-run | ||||
|             args: [] | ||||
|              | ||||
|             volumeMounts: | ||||
|               - mountPath: /data | ||||
|                 name: backup-nfs-access | ||||
|  | ||||
|             env: | ||||
|               - name: RESTIC_REPOSITORY | ||||
|                 value: rest:http://rclone-gcloud:8000/kluster | ||||
|                 # lives in the same namespace | ||||
|               - name: RESTIC_PASSWORD | ||||
|                 valueFrom: | ||||
|                   secretKeyRef: | ||||
|                     name: restic-gdrive-credentials | ||||
|                     key: restic-password | ||||
|           volumes: | ||||
|             - name: backup-nfs-access | ||||
|               persistentVolumeClaim: | ||||
|                 claimName: backup-nfs-access | ||||
							
								
								
									
										4
									
								
								infrastructure/backup/cronjobs-base/kustomization.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								infrastructure/backup/cronjobs-base/kustomization.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,4 @@ | ||||
| apiVersion: kustomize.config.k8s.io/v1beta1 | ||||
| kind: Kustomization | ||||
| resources: | ||||
|   - cronjob.yaml | ||||
		Reference in New Issue
	
	Block a user