removed pods from exclusions

added timezones to backup and restore
This commit is contained in:
2025-12-31 14:29:26 +11:00
parent f150c2bbd2
commit f85636f48f
3 changed files with 46 additions and 46 deletions

View File

@@ -6,7 +6,8 @@ metadata:
name: monthly-restore-test name: monthly-restore-test
namespace: openshift-adp namespace: openshift-adp
spec: spec:
schedule: "0 06 15 * *" # 15th of month, 6 AM timeZone: "Australia/Sydney"
schedule: "0 06 15 * *" # 15th of month, 6 AM
concurrencyPolicy: Forbid concurrencyPolicy: Forbid
successfulJobsHistoryLimit: 3 successfulJobsHistoryLimit: 3
failedJobsHistoryLimit: 3 failedJobsHistoryLimit: 3
@@ -20,44 +21,45 @@ spec:
serviceAccountName: velero serviceAccountName: velero
restartPolicy: OnFailure restartPolicy: OnFailure
containers: containers:
- name: restore-test - name: restore-test
image: quay.io/konveyor/velero:latest image: quay.io/konveyor/velero:latest
env: env:
- name: VELERO_NAMESPACE - name: VELERO_NAMESPACE
value: openshift-adp value: openshift-adp
command: command:
- /bin/bash - /bin/bash
- -c - -c
- | - |
set -e set -e
echo "=== Velero Restore Test ===" echo "=== Velero Restore Test ==="
echo "Date: $(date)" echo "Date: $(date)"
# Get latest daily-config backup # Get latest daily-config backup
CONFIG_BACKUP=$(velero backup get --selector="backup-type=config" \ CONFIG_BACKUP=$(velero backup get --selector="backup-type=config" \
-o json | jq -r '.items[0].metadata.name') -o json | jq -r '.items[0].metadata.name')
# Get latest daily-stateful backup # Get latest daily-stateful backup
STATEFUL_BACKUP=$(velero backup get --selector="backup-type=stateful" \ STATEFUL_BACKUP=$(velero backup get --selector="backup-type=stateful" \
-o json | jq -r '.items[0].metadata.name') -o json | jq -r '.items[0].metadata.name')
echo "Latest config backup: $CONFIG_BACKUP" echo "Latest config backup: $CONFIG_BACKUP"
echo "Latest stateful backup: $STATEFUL_BACKUP" echo "Latest stateful backup: $STATEFUL_BACKUP"
# Verify backups are successful # Verify backups are successful
CONFIG_STATUS=$(velero backup get $CONFIG_BACKUP -o json | \ CONFIG_STATUS=$(velero backup get $CONFIG_BACKUP -o json | \
jq -r '.status.phase') jq -r '.status.phase')
STATEFUL_STATUS=$(velero backup get $STATEFUL_BACKUP -o json | \ STATEFUL_STATUS=$(velero backup get $STATEFUL_BACKUP -o json | \
jq -r '.status.phase') jq -r '.status.phase')
echo "Config backup status: $CONFIG_STATUS" echo "Config backup status: $CONFIG_STATUS"
echo "Stateful backup status: $STATEFUL_STATUS" echo "Stateful backup status: $STATEFUL_STATUS"
if [ "$CONFIG_STATUS" != "Completed" ] || [ "$STATEFUL_STATUS" != "Completed" ]; then if [ "$CONFIG_STATUS" != "Completed" ] || [ "$STATEFUL_STATUS" != "Completed" ]; then
echo "ERROR: Backups not in Completed state" echo "ERROR: Backups not in Completed state"
exit 1 exit 1
fi fi
echo "=== Test Passed ==="
echo "All backups verified successfully"
echo "=== Test Passed ==="
echo "All backups verified successfully"

View File

@@ -6,7 +6,7 @@ metadata:
name: daily-config name: daily-config
namespace: openshift-adp namespace: openshift-adp
spec: spec:
schedule: "0 02 * * *" # 2 AM daily schedule: "CRON_TZ=Australia/Sydney 0 02 * * *" # 2 AM daily
# Make backups readable, sortable, unique # Make backups readable, sortable, unique
#nameTemplate: "{{ .ScheduleName }}-{{ .Timestamp }}" #nameTemplate: "{{ .ScheduleName }}-{{ .Timestamp }}"

View File

@@ -6,7 +6,7 @@ metadata:
name: daily-stateful name: daily-stateful
namespace: openshift-adp namespace: openshift-adp
spec: spec:
schedule: "0 03 * * *" # 3 AM daily (after config backup) schedule: "CRON_TZ=Australia/Sydney 0 03 * * *" # 3 AM daily (after config backup)
#nameTemplate: "{{ .ScheduleName }}-{{ .Timestamp }}" #nameTemplate: "{{ .ScheduleName }}-{{ .Timestamp }}"
@@ -32,8 +32,6 @@ spec:
- events.events.k8s.io - events.events.k8s.io
- pipelineruns.tekton.dev - pipelineruns.tekton.dev
- taskruns.tekton.dev - taskruns.tekton.dev
- replicasets.apps
- pods
# Use Kopia for volume backups # Use Kopia for volume backups
snapshotVolumes: false snapshotVolumes: false