Skip to content

Commit

Permalink
restore
Browse files Browse the repository at this point in the history
  • Loading branch information
james-otten committed Aug 8, 2024
1 parent 86f8366 commit 6ccaddb
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 104 deletions.
106 changes: 53 additions & 53 deletions bookstack-helm/templates/backup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion bookstack-helm/templates/backupscript.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ data:
else
echo "Not restoring"
fi
echo "done"
echo "done"
100 changes: 50 additions & 50 deletions bookstack-helm/templates/restore.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 6ccaddb

Please sign in to comment.