New Kanister functions (Long running PVC): KubeTaskWithBackupPVC + KubeTaskWithRestorePVC - #4085
Open
anand-veeam wants to merge 6 commits into
Open
anand-veeam wants to merge 6 commits into
anand-veeam wants to merge 6 commits into
Conversation
Contributor
|
This PR is marked as stale due to inactivity. Add a new comment to reactivate it. CC @kanisterio/maintainers |
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Change Overview
Add KubeTaskWithBackupPVC and KubeTaskWithRestorePVC functions
Two new Kanister functions for the long-running-PVC backup/restore pattern (logical dump → CSI snapshot → cleanup). One phase per direction. Collapses the mongoce-style multi-phase pattern (PVC create → pod create → wait → exec → snapshot → cleanup) into a single function call per direction.
Backup — provisions staging PVC, runs user command, takes CSI snapshot (via the existing createCSISnapshot helper), waits for readyToUse=true, deletes the PVC. Outputs pvcName, volumeSnapshotName, restoreSize, snapshotContent, snapshotHandle.
Restore — resolves staging PVC via volumeSnapshotName / sourcePVCName / pvcSelector (first match wins), mounts at /restore, runs user command, deletes the PVC. Uses restoreCSISnapshot helper to materialize the PVC from the snapshot.
Supports three K10 wiring patterns from the same codebase via the takeSnapshot toggle:
actions.backup / actions.restore (recommended; function owns snapshot)
BlueprintBinding hooks (backupPrehook / restorePosthook; K10 owns snapshot)
Policy ActionHooks (K10 owns snapshot)
CSI-driver-agnostic at the API layer (works with kopia-backup, Azure Disk, AWS EBS, OpenEBS, etc.). Default storage class is kopia-backup; user-overridable.
Scope: changes confined to pkg/function/. No modifications to pkg/consts, pkg/controller, or pkg/kube.
Tests: go test ./pkg/function/ -run KubeTaskWith -count=1 → PASS
E2E validation: tested end-to-end against backup-csi-driver on AKS with Postgres and MongoDB across all three wiring patterns.
Here is doc for this function : https://kasten.atlassian.net/wiki/spaces/EN/pages/4495474776/New+Kanister+function+Long+running+PVC+DumpVolume
Pull request type
Please check the type of change your PR introduces:
Issues
Test Plan