Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
usingtechnology committed Sep 24, 2024
2 parents 2126e56 + 70c6915 commit 63c78ea
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 5 deletions.
24 changes: 22 additions & 2 deletions openshift/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ Refer to the `patroni.dc.yaml` and `patroni.secret.yaml` files found below for a
After backups are made a verification job should be run to restore the backup into a temporary database and check that tables are created and data is written. This is not a full verification to ensure all data integrity, but it is an automatable first step.
Using the `backup-cronjon-verify.yaml` file from the `redash` directory:
Using the `backup-cronjon-verify.yaml` file from the `redash` directory we will use the default resource values for the Development and Test Environments:
```sh
export NAMESPACE=<yournamespace>
Expand All @@ -271,6 +271,26 @@ oc process -f backup-cronjob-verify.yaml \
-p JOB_NAME=backup-postgres-verify \
-p JOB_PERSISTENT_STORAGE_NAME=$PVC \
-p SCHEDULE="0 9 * * *" \
-p TAG_NAME=2.8.0 \
-p TAG_NAME=2.9.0 \
| oc -n $NAMESPACE apply -f -
```
For the Production environment we have a much larger database and we want the verification to complete within a reasonable amount of time. Increase the limits so that the container is not memory- or cpu-bound:
```sh
export NAMESPACE=<yournamespace>
export PVC=<yourpvcname>
oc process -f backup-cronjob-verify.yaml \
-p BACKUP_JOB_CONFIG=backup-postgres-config \
-p DATABASE_DEPLOYMENT_NAME=patroni-master-secret \
-p DATABASE_PASSWORD_KEY_NAME=app-db-password \
-p DATABASE_USER_KEY_NAME=app-db-username \
-p JOB_NAME=backup-postgres-verify \
-p JOB_PERSISTENT_STORAGE_NAME=$PVC \
-p RESOURCE_LIMIT_CPU="1500m" \
-p RESOURCE_LIMIT_MEMORY="1Gi" \
-p SCHEDULE="0 9 * * *" \
-p TAG_NAME=2.9.0 \
| oc -n $NAMESPACE apply -f -
```
4 changes: 2 additions & 2 deletions openshift/redash/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ oc process -f backup-cronjob.yaml \
-p JOB_PERSISTENT_STORAGE_NAME=backup-chefs-redash-postgresql \
-p MONTHLY_BACKUPS=3 \
-p SCHEDULE="0 8 * * *" \
-p TAG_NAME=2.8.0 \
-p TAG_NAME=2.9.0 \
-p WEEKLY_BACKUPS=8 \
| oc -n a12c97-tools apply -f -
```
Expand All @@ -42,7 +42,7 @@ oc process -f backup-cronjob-verify.yaml \
-p JOB_NAME=backup-chefs-redash-postgres-verify \
-p JOB_PERSISTENT_STORAGE_NAME=backup-chefs-redash-postgresql \
-p SCHEDULE="0 9 * * *" \
-p TAG_NAME=2.8.0 \
-p TAG_NAME=2.9.0 \
| oc -n a12c97-tools apply -f -
```

Expand Down
29 changes: 28 additions & 1 deletion openshift/redash/backup-cronjob-verify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,26 @@ parameters:
description: "Pre-Created PVC to use for backup target"
value: "bk-devex-von-tools-a9vlgd1jpsg1"
required: true
- name: "RESOURCE_LIMIT_CPU"
displayName: "CPU Limit"
description: "The maximium CPU resources for the container"
value: "250m"
required: true
- name: "RESOURCE_LIMIT_MEMORY"
displayName: "Memory Limit"
description: "The maximium memory resources for the container"
value: "1Gi"
required: true
- name: "RESOURCE_REQUEST_CPU"
displayName: "CPU Request"
description: "The minimium CPU resources for the container"
value: "50m"
required: true
- name: "RESOURCE_REQUEST_MEMORY"
displayName: "Memory Request"
description: "The minimium memory resources for the container"
value: "256Mi"
required: true
- name: "SCHEDULE"
displayName: "Cron Schedule"
description: "Cron Schedule to Execute the Job (using local cluster system TZ)"
Expand Down Expand Up @@ -161,12 +181,19 @@ objects:
spec:
containers:
- name: "${JOB_NAME}-cronjob"
resources:
limits:
cpu: "${RESOURCE_LIMIT_CPU}"
memory: "${RESOURCE_LIMIT_MEMORY}"
requests:
cpu: "${RESOURCE_REQUEST_CPU}"
memory: "${RESOURCE_REQUEST_MEMORY}"
image: "${IMAGE_REGISTRY}/${IMAGE_NAMESPACE}/${SOURCE_IMAGE_NAME}:${TAG_NAME}"
# image: backup
command:
- "/bin/bash"
- "-c"
- "/backup.sh -v all"
- "/backup.sh -I -v all"
volumeMounts:
- mountPath: "${BACKUP_DIR}"
name: "backup"
Expand Down

0 comments on commit 63c78ea

Please sign in to comment.