Skip to content

Commit a05e63c

Browse files
committed
adding in instructions for how to setup the backup-container for our keycloak instance'
1 parent 0fb5f9b commit a05e63c

File tree

3 files changed

+70
-42
lines changed

3 files changed

+70
-42
lines changed

backup-container/helm/config/config.yaml

Lines changed: 0 additions & 25 deletions
This file was deleted.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
image:
2+
repository: ghcr.io/bcgov/backup-container
3+
pullPolicy: IfNotPresent
4+
tag: 2.10.3
5+
6+
backupConfig: |
7+
postgres=sso-patroni:5432/ssokeycloak
8+
9+
0 1 * * * default ./backup.sh -s
10+
0 4 * * * default ./backup.sh -I -v all
11+
12+
db:
13+
secretName: "sso-patroni"
14+
usernameKey: "username-superuser"
15+
passwordKey: "password-superuser"
16+
17+
env:
18+
DATABASE_SERVICE_NAME:
19+
value: "postgres"
20+
ENVIRONMENT_FRIENDLY_NAME:
21+
value: "SSO DB Backups"
22+
SSO_PATRONI_PASSWORD:
23+
existingSecret:
24+
name: "sso-patroni-appusers"
25+
key: "password-appuser1"
26+
SSO_PATRONI_USER:
27+
existingSecret:
28+
name: "sso-patroni-appusers"
29+
key: "username-appuser1"
30+
# use the following syntax to wire-up an existing secret
31+
# EXISTING_DEPLOYMENT_PASSWORD:
32+
# existingSecret:
33+
# name: "existing-secret-name"
34+
# key: "existing-secret-key"
35+
36+
persistence:
37+
backup:
38+
size: 5Gi
39+
mountPath: /backups/
40+
storageClassName: netapp-file-backup
41+
storageAccessMode: ReadWriteOnce
42+
verification:
43+
size: 2Gi
44+
mountPath: /var/lib/pgsql/data
45+
storageClassName: netapp-block-standard
46+
storageAccessMode: ReadWriteOnce

backup-container/helm/readme.md

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
# How to deploy backup container using Helm and config file
1+
# How to deploy backup container using Helm and config file
2+
3+
## This will explain how to set up a backup container for our sso-keycloak instance along with the values.yaml file to use with helm.
4+
5+
## Reference:
26

3-
## Reference:
47
- [backup-container](https://github.com/BCDevOps/backup-container?tab=readme-ov-file#deploy-with-helm-chart) we refer to this for instructions on how to deploy
58
- [helm charts](https://github.com/bcgov/helm-charts/tree/master/charts/backup-storage)
69
- [installing helm](https://helm.sh/docs/intro/install/)
@@ -10,28 +13,32 @@ oc login --web //logs you into openshift
1013
helm repo add bcgov http://bcgov.github.io/helm-charts //install the charts
1114
```
1215

13-
Navigate to the config.yaml configuration folder
14-
```
15-
helm upgrade --install backup-patroni bcgov/backup-storage -n <<NAMESPACE>> -f <<CONFIG LOCATION>>
16+
Navigate to the config.yaml configuration folder these commands were run in WSL. Powershell will require a different order to the inputs.
1617

17-
example:
18-
helm upgrade --install backup-patroni bcgov/backup-storage -n 75e61b-dev -f config.yaml
1918
```
19+
helm upgrade --install backup-sso-keycloak bcgov/backup-storage -n <<NAMESPACE>> -f <<VALUES LOCATION>>
2020
21-
Notes:
21+
example run in the folder with the values.yaml:
22+
helm upgrade --install backup-sso-keycloak bcgov/backup-storage -n 75e61b-dev -f values.yaml
23+
```
2224

23-
- One of the errors I had while backing up was
24-
- to fix, I updated the tag on the config.yaml to be the latest offered by bcDevops/backup-container 2.9.0 at the time of writing this readme.
25+
Notes:
2526

27+
- One of the errors I had while backing up was
2628

2729
> pg_dump: error: server version: 15.6 (Ubuntu 15.6-1.pgdg22.04+1); pg_dump version: 14.7
28-
pg_dump: error: aborting because of server version mismatch
30+
> pg_dump: error: aborting because of server version mismatch
31+
32+
- to fix, I updated the tag on the config.yaml to be the latest offered by bcDevops/backup-container 2.10.3 at the time of writing this readme.
33+
34+
- how do I verify that the backups work?
35+
36+
- I rsynced into the pods and downloaded the .gz backups and opened them in dbeaver.
37+
- run ./backup.sh -I -v all in the pod
2938

30-
39+
- When backing up pods in patroni use ./backup.sh -I -v. This ignores some dependencies that patroni requires. Source: https://github.com/bcgov/backup-container/blob/fca9861a5c12a61c85baf6ca84e1dbf60abb5ad5/docs/TipsAndTricks.md?plain=1#L77
3140

32-
- unable to find persistence volume claim
33-
- to fix had to create a persistence volume claim matching what was set in the config.yaml file.
34-
![alt text](image.png)
41+
- Remember to add the correct environment variable otherwise the backup verification won't work. https://github.com/bcgov/backup-container?tab=readme-ov-file#backupconf ex. SSO_PATRONI_USER and SSO_PATRONI_PASSWORD.
3542

36-
- how do I verify that the backups work?
37-
- I rsynced into the pods and downloaded the .gz backups and opened them in dbeaver.
43+
- Issue verification process hangs and server does not start.
44+
- https://github.com/bcgov/backup-container/issues/151#issuecomment-2956503224 do not use the default postgres superuser. Odd issue where it might cause the verification to hang. I ended up using another user secret appuser1.

0 commit comments

Comments
 (0)