now working with the secret reference
This commit is contained in:
		| @@ -1,8 +1,8 @@ | |||||||
| apiVersion: kustomize.config.k8s.io/v1beta1 | apiVersion: kustomize.config.k8s.io/v1beta1 | ||||||
| kind: Kustomization | kind: Kustomization | ||||||
|  |  | ||||||
| # namespace: backup | namespace: backup | ||||||
| nameSuffix: -backup | # nameSuffix: -backup | ||||||
| resources: | resources: | ||||||
|   - ../../base |   - ../../base | ||||||
|   # - ./restic-commands.yaml |   # - ./restic-commands.yaml | ||||||
| @@ -10,7 +10,15 @@ resources: | |||||||
|  |  | ||||||
| # patch the cronjob args field: | # patch the cronjob args field: | ||||||
| patches: | patches: | ||||||
|   - path: ./restic-commands.yaml |   - path: restic-commands.yaml | ||||||
|     target: |     target: | ||||||
|       kind: CronJob |       kind: CronJob | ||||||
|        |       name: restic-rclone-gdrive | ||||||
|  |   - target: | ||||||
|  |       kind: CronJob | ||||||
|  |       name: restic-rclone-gdrive | ||||||
|  |       # replace the name of the cronjob | ||||||
|  |     patch: |- | ||||||
|  |       - op: replace | ||||||
|  |         path: /metadata/name | ||||||
|  |         value: restic-gdrive-backup | ||||||
| @@ -1,7 +1,7 @@ | |||||||
| apiVersion: batch/v1 | apiVersion: batch/v1 | ||||||
| kind: CronJob | kind: CronJob | ||||||
| metadata: | metadata: | ||||||
|   name: backup-patch |   name: restic-gdrive-backup | ||||||
| spec: | spec: | ||||||
|   schedule: "0 2 * * *" |   schedule: "0 2 * * *" | ||||||
|   # at 2:00, every day |   # at 2:00, every day | ||||||
| @@ -22,9 +22,4 @@ spec: | |||||||
|                   --exclude=s3/ |                   --exclude=s3/ | ||||||
|                   && |                   && | ||||||
|                   restic |                   restic | ||||||
|                   list snapshots |                   list snapshots | ||||||
|             env: |  | ||||||
|               - name: RESTIC_PASSWORD |  | ||||||
|                 valueFrom: |  | ||||||
|                   secretKeyRef: |  | ||||||
|                     name: restic-gdrive-credentials-backup |  | ||||||
| @@ -1,15 +1,22 @@ | |||||||
| apiVersion: kustomize.config.k8s.io/v1beta1 | apiVersion: kustomize.config.k8s.io/v1beta1 | ||||||
| kind: Kustomization | kind: Kustomization | ||||||
|  |  | ||||||
| # namespace: backup | namespace: backup | ||||||
| nameSuffix: -prune |  | ||||||
| resources: | resources: | ||||||
|   - ../../base |   - ../../base | ||||||
|   # - ./restic-commands.yaml |  | ||||||
|  |  | ||||||
|  |  | ||||||
| # patch the cronjob args field: | # patch the cronjob args field: | ||||||
| patches: | patches: | ||||||
|   - path: ./restic-commands.yaml |   - path: restic-commands.yaml | ||||||
|     target: |     target: | ||||||
|       kind: CronJob |       kind: CronJob | ||||||
|  |       name: restic-rclone-gdrive | ||||||
|  |   - target: | ||||||
|  |       kind: CronJob | ||||||
|  |       name: restic-rclone-gdrive | ||||||
|  |       # replace the name of the cronjob | ||||||
|  |     patch: |- | ||||||
|  |       - op: replace | ||||||
|  |         path: /metadata/name | ||||||
|  |         value: restic-gdrive-prune | ||||||
| @@ -1,7 +1,7 @@ | |||||||
| apiVersion: batch/v1 | apiVersion: batch/v1 | ||||||
| kind: CronJob | kind: CronJob | ||||||
| metadata: | metadata: | ||||||
|   name: prune-patch |   name: restic-gdrive-prune | ||||||
| spec: | spec: | ||||||
|   schedule: "0 0 1/15 * *" |   schedule: "0 0 1/15 * *" | ||||||
|   # at midnight, the first and 15. of every month |   # at midnight, the first and 15. of every month | ||||||
| @@ -22,8 +22,3 @@ spec: | |||||||
|                   --verbose=2 |                   --verbose=2 | ||||||
|                   --keep-daily 7 --keep-weekly 5 |                   --keep-daily 7 --keep-weekly 5 | ||||||
|                   --prune |                   --prune | ||||||
|             env: |  | ||||||
|               - name: RESTIC_PASSWORD |  | ||||||
|                 valueFrom: |  | ||||||
|                   secretKeyRef: |  | ||||||
|                     name: restic-gdrive-credentials-backup |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user