-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: update the backup container process #350
Merged
Merged
Changes from 16 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
3203b16
chore: reduce dev and test backup frequency to save space
thegentlemanphysicist 3a0e331
Merge branch 'dev' of github.com:bcgov/sso-keycloak into dev
thegentlemanphysicist 07cac36
Merge branch 'dev' of github.com:bcgov/sso-keycloak into dev
thegentlemanphysicist f73a8d5
Merge branch 'dev' of github.com:bcgov/sso-keycloak into dev
thegentlemanphysicist 6ea9314
Merge branch 'dev' of github.com:bcgov/sso-keycloak into dev
thegentlemanphysicist 7718f5f
Merge branch 'dev' of github.com:bcgov/sso-keycloak into dev
thegentlemanphysicist 443661d
Merge branch 'dev' of github.com:bcgov/sso-keycloak into dev
thegentlemanphysicist ada90eb
Merge branch 'dev' of github.com:bcgov/sso-keycloak into dev
thegentlemanphysicist 33500a7
Merge branch 'dev' of github.com:bcgov/sso-keycloak into dev
thegentlemanphysicist 7f77298
Merge branch 'dev' of github.com:bcgov/sso-keycloak into dev
thegentlemanphysicist da518bd
Merge branch 'dev' of github.com:bcgov/sso-keycloak into dev
thegentlemanphysicist 9b4b6e7
Merge branch 'dev' of github.com:bcgov/sso-keycloak into dev
thegentlemanphysicist 0012236
chore: clean up backup process and documentation
thegentlemanphysicist 9db6940
chore: remove webhook template
thegentlemanphysicist 3f85434
chore: update prod helm charts and remove test webhook
thegentlemanphysicist b67095c
chore: update the verification config
thegentlemanphysicist ef9b06c
chore: simplify the backup image creation action
thegentlemanphysicist File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,43 @@ | ||
# The sso-keycloak implementation of the backup container | ||
|
||
## **BEFORE RUNNING HELM UPGRADE:** | ||
As part of the backup restore process we can build and host backup-container images that our helm charts can use to deploy the container. However, currently we are using the backup container's hosted images. | ||
|
||
Make sure to add the rocket chat webhook to production facing values files. Make sure not to commit this value. | ||
The backup container repo we use is [here](https://github.com/BCDevOps/backup-container). | ||
|
||
## Intro to backup container | ||
|
||
The current patroni clusters are backud up using a modified version of the platform services backup container. This is due to an issue with the spilo patroni image. | ||
## The verification and restore process | ||
|
||
The backup container repo is [here](https://github.com/BCDevOps/backup-container). | ||
Currently running backup restoration and verification againts the patroni cluster raises several errors, meaning the `-I` flag needs to be added to the verification config and restoration process. To verify a backup run: | ||
|
||
The modified postgres plugin can be found [here](https://github.com/bcgov/sso-keycloak/blob/dev/docker/backup-container/backup.postgres.plugin). | ||
`./backup.sh -I -v all` | ||
|
||
A side effect of this conflict is that we cannot currently verify the daily backups with a test restoration. | ||
To restore from a backup: | ||
|
||
## Installing and upgrading backups | ||
`./backup.sh -I -r sso-patroni:5432/ssokeycloak` | ||
|
||
These charts can be upgraded using make commands: | ||
Furhter documentation can be found in the backup container's [repos](https://github.com/BCDevOps/backup-container) | ||
|
||
`make upgrade NAME=sso-backup NAMESPACE=<<namespace>>` | ||
## Building the image | ||
|
||
As of May 2024 we are using the backup-container's images directly in our deployments. However the action `.github/workflows/publish-image-backup-storage-gold.yml` allows us create a backup container image with files overridden by those in the folder `sso-keycloak/docker/backup-container/*`. We can tag the image and then use it in our helm chart via the yaml stanza: | ||
|
||
``` | ||
image: | ||
repository: ghcr.io/bcgov/backup-storage | ||
tag: <<TAG NAME>> | ||
pullPolicy: Always | ||
``` | ||
|
||
To restore from the most recent backup, follow the docs `sso-keycloak/docs/bkp-and-restore-keycloak-db.md` | ||
## Deploying the charts | ||
|
||
### **BEFORE RUNNING HELM UPGRADE:** | ||
|
||
Deprecated method left as an example: rsh into the backup pod in the namespace in question and run: | ||
Make sure to add the rocket chat webhook to production facing values files. Make sure not to commit this value. | ||
|
||
Make certain the image tag reflects the version of the backup container you intend to deploy. | ||
|
||
**dev silver production**: | ||
### Installing and upgrading backups | ||
|
||
`./backup.sh -r postgres=sso-pgsql-dev-11-patroni:5432/rhsso` | ||
These charts can be upgraded using make commands: | ||
|
||
`make upgrade NAME=sso-backup NAMESPACE=<<namespace>>` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
nameOverride: sso-backup-storage | ||
fullnameOverride: sso-backup-storage | ||
|
||
image: | ||
repository: bcgovimages/backup-container | ||
tag: 2.8.1 | ||
pullPolicy: Always | ||
|
||
backupConfig: | | ||
sso-patroni:5432/ssokeycloak | ||
0 1 * * * default ./backup.sh -s | ||
0 4 * * * default ./backup.sh -I -s -v all | ||
|
||
db: | ||
secretName: sso-patroni-appusers | ||
usernameKey: username-appuser1 | ||
passwordKey: password-appuser1 | ||
|
||
persistence: | ||
backup: | ||
size: 5Gi | ||
|
||
env: | ||
ENVIRONMENT_FRIENDLY_NAME: | ||
value: 'SSO Sandbox Client Dev Backup' | ||
ENVIRONMENT_NAME: | ||
value: e4ca1d-dev | ||
WEBHOOK_URL: | ||
# value: '<<WEBHOOK URL FOR ROCKETCHAT>>' | ||
secure: true | ||
|
||
DAILY_BACKUPS: | ||
value: '3' | ||
WEEKLY_BACKUPS: | ||
value: '2' | ||
MONTHLY_BACKUPS: | ||
value: '1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
nameOverride: sso-backup-storage | ||
fullnameOverride: sso-backup-storage | ||
|
||
image: | ||
repository: bcgovimages/backup-container | ||
tag: 2.8.1 | ||
pullPolicy: Always | ||
|
||
backupConfig: | | ||
sso-patroni:5432/ssokeycloak | ||
0 1 * * * default ./backup.sh -s | ||
0 4 * * * default ./backup.sh -I -s -v all | ||
|
||
db: | ||
secretName: sso-patroni-appusers | ||
usernameKey: username-appuser1 | ||
passwordKey: password-appuser1 | ||
|
||
persistence: | ||
backup: | ||
size: 5Gi | ||
|
||
env: | ||
ENVIRONMENT_FRIENDLY_NAME: | ||
value: 'SSO Sandbox Client Prod Backup' | ||
ENVIRONMENT_NAME: | ||
value: e4ca1d-prod | ||
WEBHOOK_URL: | ||
# value: '<<WEBHOOK URL FOR ROCKETCHAT>>' | ||
secure: true | ||
|
||
DAILY_BACKUPS: | ||
value: '3' | ||
WEEKLY_BACKUPS: | ||
value: '2' | ||
MONTHLY_BACKUPS: | ||
value: '1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
nameOverride: sso-backup-storage | ||
fullnameOverride: sso-backup-storage | ||
|
||
image: | ||
repository: bcgovimages/backup-container | ||
tag: 2.8.1 | ||
pullPolicy: Always | ||
|
||
backupConfig: | | ||
sso-patroni:5432/ssokeycloak | ||
0 1 * * * default ./backup.sh -s | ||
0 4 * * * default ./backup.sh -I -s -v all | ||
|
||
db: | ||
secretName: sso-patroni-appusers | ||
usernameKey: username-appuser1 | ||
passwordKey: password-appuser1 | ||
|
||
persistence: | ||
backup: | ||
size: 5Gi | ||
|
||
env: | ||
ENVIRONMENT_FRIENDLY_NAME: | ||
value: 'SSO Sandbox Client Test Backup' | ||
ENVIRONMENT_NAME: | ||
value: e4ca1d-test | ||
WEBHOOK_URL: | ||
# value: '<<WEBHOOK URL FOR ROCKETCHAT>>' | ||
secure: true | ||
|
||
DAILY_BACKUPS: | ||
value: '3' | ||
WEEKLY_BACKUPS: | ||
value: '2' | ||
MONTHLY_BACKUPS: | ||
value: '1' |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess their image has a template built in so we don't need this anymore?