Documentdb backup-restore addons - #2431
Conversation
The addon was applied by hand; add it to kubedb-kubestash-catalog so it installs with KubeDB/KubeStash like every other database. Adds the DocumentDB feature gate (present in kubedb-catalog but missing here), a documentdb values section, and five templates following the postgres naming convention: documentdb-backup, documentdb-restore, documentdb-physical-backup, documentdb-physical-backup-restore and documentdb-addon. The logical tasks are declared for parity and are not usable - the plugin refuses a DocumentDB target because pg_dump cannot capture the extension-owned collection catalog, so a logical snapshot would restore with no collections. Shipping them named correctly means selecting one fails immediately with that reason instead of the task simply not existing. documentdb-physical-backup-restore pins its tag instead of using . A physical restore targets the data PVC directly, since the database does not exist while waitForInitialRestore holds the gate closed, and KubeStash resolves from an AppBinding named after the target - so it looks for AppBinding/data-<db>-0 and the session fails before the job is created. DocumentDBVersion gains addonPostgresVersion: "17.2", the version published on the <db>-admin AppBinding and the one that resolves for the backup Functions. Without it the operator does not create that AppBinding at all. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: sabnaj <sabnaj@appscode.com>
There was a problem hiding this comment.
🟡 Changes recommended
Generated artifacts/API schema sources aren’t updated to fully reflect the new DocumentDB values/addon behavior, and there’s conflicting documentation in the new values section.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds DocumentDB backup/restore addon support by extending the KubeStash catalog chart and DocumentDBVersion metadata so KubeStash can dispatch the Postgres-based plugin correctly for DocumentDB.
Changes:
- Enable DocumentDB via chart feature gates and add DocumentDB-specific values.
- Introduce DocumentDB KubeStash Addon + Functions (logical + physical backup/restore) using
kubedb/postgres-restic-plugin. - Add
spec.addonPostgresVersionto DocumentDBVersion CRD/manifests (and set it for DocumentDB 0.109.0).
File summaries
| File | Description |
|---|---|
| charts/kubedb-kubestash-catalog/values.yaml | Enables DocumentDB and adds chart values for DocumentDB backup/restore args. |
| charts/kubedb-kubestash-catalog/templates/documentdb/documentdb-addon.yaml | Defines the documentdb-addon with logical/physical backup+restore tasks. |
| charts/kubedb-kubestash-catalog/templates/documentdb/documentdb-backup.yaml | Adds the logical backup Function for DocumentDB. |
| charts/kubedb-kubestash-catalog/templates/documentdb/documentdb-restore.yaml | Adds the logical restore Function for DocumentDB. |
| charts/kubedb-kubestash-catalog/templates/documentdb/documentdb-physical-backup.yaml | Adds the physical backup Function for DocumentDB. |
| charts/kubedb-kubestash-catalog/templates/documentdb/documentdb-physical-backup-restore.yaml | Adds the physical restore Function for DocumentDB with a pinned backend version tag. |
| charts/kubedb-crds/crds/catalog.kubedb.com_documentdbversions.yaml | Extends the DocumentDBVersion CRD schema with addonPostgresVersion. |
| charts/kubedb-certified-crds/crds/catalog.kubedb.com_documentdbversions.yaml | Mirrors the CRD schema change for the certified CRDs chart. |
| charts/kubedb-catalog/crds/catalog.kubedb.com_documentdbversions.yaml | Mirrors the CRD schema change for the catalog chart. |
| charts/kubedb-catalog/templates/documentdb/documentdb-0.109.0.yaml | Sets addonPostgresVersion: "17.2" for DocumentDB 0.109.0 in the chart template. |
| catalog/kubedb/raw/documentdb/documentdb-0.109.0.yaml | Sets addonPostgresVersion: "17.2" in the raw catalog manifest (with explanatory comment). |
Review details
- Files reviewed: 11/11 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| featureGates: | ||
| ClickHouse: true | ||
| Cassandra: true | ||
| DocumentDB: true |
| # The Postgres version the backend actually runs, in the x.y form the KubeStash addon dispatches | ||
| # on. Published as spec.version on the <db>-admin AppBinding, which is what resolves ${DB_VERSION} | ||
| # in the documentdb-* Function image tags. Without it the operator does not create that | ||
| # AppBinding at all and backup has nothing to target. | ||
| addonPostgresVersion: "17.2" |
Signed-off-by: sabnaj <sabnaj@appscode.com>
Signed-off-by: sabnaj <sabnaj@appscode.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Sabnaj-42 <106393405+Sabnaj-42@users.noreply.github.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (7)
🚧 Files skipped from review as they are similar to previous changes (2)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe catalog adds the ChangesDocumentDB backup and restore
Priority: ➖ Normal Estimated code review effort: 4 (Complex) | ~45 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant DocumentDBVersion
participant DocumentDBAddon
participant KubeStashFunction
participant PostgresResticPlugin
DocumentDBVersion->>DocumentDBAddon: provide postgresPluginVersion 17.2
DocumentDBAddon->>KubeStashFunction: dispatch backup or restore task
KubeStashFunction->>PostgresResticPlugin: execute configured operation
PostgresResticPlugin-->>DocumentDBAddon: process backup or restore data
Suggested reviewers: Merge Risk: ⚪ Minimal · up to The DocumentDB backup and restore catalog additions have no established merge-blocking failure in the current change. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 3 files. (7 skipped: 7 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| # Nothing here passes a DocumentDB-specific parameter - the plugin branches on the AppBinding's | ||
| # appRef Kind, the same way it does for Druid. | ||
| apiVersion: addons.kubestash.com/v1alpha1 | ||
| kind: Addon |
There was a problem hiding this comment.
addon, function should be included in catalog/kubestash/raw/documentdb
Signed-off-by: sabnaj <sabnaj@appscode.com>
Signed-off-by: sabnaj <sabnaj@appscode.com>
Summary by CodeRabbit