From 6ccaddb5f218985df0c1b709c01ac99253a1a144 Mon Sep 17 00:00:00 2001 From: james-otten Date: Wed, 7 Aug 2024 21:42:06 -0400 Subject: [PATCH] restore --- bookstack-helm/templates/backup.yaml | 106 ++++++++++----------- bookstack-helm/templates/backupscript.yaml | 2 +- bookstack-helm/templates/restore.yaml | 100 +++++++++---------- 3 files changed, 104 insertions(+), 104 deletions(-) diff --git a/bookstack-helm/templates/backup.yaml b/bookstack-helm/templates/backup.yaml index cf0b5dd..0e6a641 100644 --- a/bookstack-helm/templates/backup.yaml +++ b/bookstack-helm/templates/backup.yaml @@ -11,57 +11,57 @@ spec: spec: restartPolicy: OnFailure containers: - - name: backupjob - image: "{{ .Values.db_image.repository }}:{{ .Values.db_image.tag }}" - imagePullPolicy: {{ .Values.db_image.pullPolicy }} - command: - - /bin/bash - - /backup.sh - volumeMounts: - - name: backup-script - mountPath: /backup.sh - subPath: backup.sh - readOnly: true - env: - - name: DB_HOST - valueFrom: - configMapKeyRef: - name: wikiconfig - key: DB_HOST - - name: DB_DATABASE - valueFrom: - configMapKeyRef: - name: wikiconfig - key: DB_DATABASE - - name: DB_USER - valueFrom: - secretKeyRef: - name: wiki-secrets - key: db-username - - name: DB_PASS - valueFrom: - secretKeyRef: - name: wiki-secrets - key: db-password - - name: BACKUP_S3_URL - valueFrom: - secretKeyRef: - name: wiki-secrets - key: backup-s3-url - - name: AWS_ACCESS_KEY_ID - valueFrom: - secretKeyRef: - name: wiki-secrets - key: access-key-id - - name: AWS_SECRET_ACCESS_KEY - valueFrom: - secretKeyRef: - name: wiki-secrets - key: secret-access-key + - name: backupjob + image: "{{ .Values.db_image.repository }}:{{ .Values.db_image.tag }}" + imagePullPolicy: {{ .Values.db_image.pullPolicy }} + command: + - /bin/bash + - /backup.sh + volumeMounts: + - name: backup-script + mountPath: /backup.sh + subPath: backup.sh + readOnly: true + env: + - name: DB_HOST + valueFrom: + configMapKeyRef: + name: wikiconfig + key: DB_HOST + - name: DB_DATABASE + valueFrom: + configMapKeyRef: + name: wikiconfig + key: DB_DATABASE + - name: DB_USER + valueFrom: + secretKeyRef: + name: wiki-secrets + key: db-username + - name: DB_PASS + valueFrom: + secretKeyRef: + name: wiki-secrets + key: db-password + - name: BACKUP_S3_URL + valueFrom: + secretKeyRef: + name: wiki-secrets + key: backup-s3-url + - name: AWS_ACCESS_KEY_ID + valueFrom: + secretKeyRef: + name: wiki-secrets + key: access-key-id + - name: AWS_SECRET_ACCESS_KEY + valueFrom: + secretKeyRef: + name: wiki-secrets + key: secret-access-key volumes: - - name: backup-script - configMap: - name: backup-script - items: - - key: backup.sh - path: backup.sh + - name: backup-script + configMap: + name: backup-script + items: + - key: backup.sh + path: backup.sh diff --git a/bookstack-helm/templates/backupscript.yaml b/bookstack-helm/templates/backupscript.yaml index c216e65..4cc5afc 100644 --- a/bookstack-helm/templates/backupscript.yaml +++ b/bookstack-helm/templates/backupscript.yaml @@ -28,4 +28,4 @@ data: else echo "Not restoring" fi - echo "done" \ No newline at end of file + echo "done" diff --git a/bookstack-helm/templates/restore.yaml b/bookstack-helm/templates/restore.yaml index 65de21a..9b492e1 100644 --- a/bookstack-helm/templates/restore.yaml +++ b/bookstack-helm/templates/restore.yaml @@ -2,60 +2,60 @@ apiVersion: batch/v1 kind: Job metadata: name: restorejob - namespace: {{ .Values.meshwiki_app_namespace }} + namespace: { { .Values.meshwiki_app_namespace } } spec: jobTemplate: spec: template: spec: containers: - - name: restorejob - image: "{{ .Values.db_image.repository }}:{{ .Values.db_image.tag }}" - imagePullPolicy: {{ .Values.db_image.pullPolicy }} - restartPolicy: OnFailure - command: - - /bin/bash - - /restore.sh - volumeMounts: - - name: backup-script - mountPath: /restore.sh - subPath: restore.sh - readOnly: true - env: - - name: DB_HOST - valueFrom: - configMapKeyRef: - name: wikiconfig - key: DB_HOST - - name: DB_USER - valueFrom: - secretKeyRef: - name: wiki-secrets - key: db-username - - name: DB_PASS - valueFrom: - secretKeyRef: - name: wiki-secrets - key: db-password - - name: RESTORE_S3_URL - valueFrom: - secretKeyRef: - name: wiki-secrets - key: restore-s3-url - - name: AWS_ACCESS_KEY_ID - valueFrom: - secretKeyRef: - name: wiki-secrets - key: access-key-id - - name: AWS_SECRET_ACCESS_KEY - valueFrom: - secretKeyRef: - name: wiki-secrets - key: secret-access-key + - name: restorejob + image: "{{ .Values.db_image.repository }}:{{ .Values.db_image.tag }}" + imagePullPolicy: { { .Values.db_image.pullPolicy } } + command: + - /bin/bash + - /restore.sh + volumeMounts: + - name: backup-script + mountPath: /restore.sh + subPath: restore.sh + readOnly: true + env: + - name: DB_HOST + valueFrom: + configMapKeyRef: + name: wikiconfig + key: DB_HOST + - name: DB_USER + valueFrom: + secretKeyRef: + name: wiki-secrets + key: db-username + - name: DB_PASS + valueFrom: + secretKeyRef: + name: wiki-secrets + key: db-password + - name: RESTORE_S3_URL + valueFrom: + secretKeyRef: + name: wiki-secrets + key: restore-s3-url + - name: AWS_ACCESS_KEY_ID + valueFrom: + secretKeyRef: + name: wiki-secrets + key: access-key-id + - name: AWS_SECRET_ACCESS_KEY + valueFrom: + secretKeyRef: + name: wiki-secrets + key: secret-access-key + restartPolicy: OnFailure volumes: - - name: backup-script - configMap: - name: backup-script - items: - - key: restore.sh - path: restore.sh + - name: backup-script + configMap: + name: backup-script + items: + - key: restore.sh + path: restore.sh