feat: add ScheduledBackup CR for Woodpecker CNPG cluster #88
No reviewers
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo_admin/pal-e-platform!88
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "87-feat-add-scheduledbackup-cr-for-woodpeck"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Adds a CNPG
ScheduledBackupcustom resource for the Woodpecker database cluster. Daily base backups at 03:00 UTC to MinIO via barmanObjectStore. This ensures jwt-secret and pipeline history survive DB rebuilds -- restore-from-backup instead of fresh DB creation.Changes
terraform/main.tf: Addedkubernetes_manifest.woodpecker_postgres_scheduled_backupresource -- aScheduledBackupCR targeting thewoodpecker-dbCNPG cluster in thewoodpeckernamespace. Schedule0 0 3 * * *(03:00 UTC daily), methodbarmanObjectStore, backupOwnerReferencecluster. Depends on the existingwoodpecker_postgrescluster resource.tofu plan Output
The 1 add is the new
kubernetes_manifest.woodpecker_postgres_scheduled_backup. The 1 change is a cosmetic write-only attribute drift onkubernetes_secret_v1.woodpecker_db_credentials(no actual change).Test Plan
tofu fmt -recursive-- passed, no formatting changes to main.tftofu validate-- passed ("The configuration is valid")tofu plan -lock=false -target=kubernetes_manifest.woodpecker_postgres_scheduled_backup-- shows 1 to addkubectl get scheduledbackups -n woodpeckershould showwoodpecker-db-dailykubectl get backups -n woodpeckershould show a completed backup objectReview Checklist
Related
plan-pal-e-platform-- Platform HardeningSelf-Review: PASS
Files reviewed:
terraform/main.tf(+28, -0)Findings: None.
ScheduledBackupCR spec is correct:apiVersion,kind,schedule(6-field cron with seconds),backupOwnerReference,method,cluster.nameall validkubernetes_namespace_v1.woodpecker.metadata[0].name, consistent with the existing Cluster CRdepends_oncorrectly gates on the CNPG Cluster resourcewoodpecker_postgresresourcetofu fmt,tofu validate, andtofu planall passTofu Plan Output