This topic mainly describes how to achieve sandbox data persistence in VCI Agent Sandbox.
For system volume snapshots, SandboxSnapShot (Namespaced) and SandboxSnapShotClass (Cluster-scoped) are introduced to abstract the snapshot capability of sandboxes in a unified manner.
- SandboxSnapShot: Creates a snapshot for a specific sandbox and records the snapshot status, ID, retention duration, and other information.
- SandboxSnapShotClass: Describes the underlying snapshot generation parameters and the default deletion policy.
tip
The time required to create a system volume snapshot is related to the size of temporary data generated in the system volume. Therefore, you need to avoid restoring sandboxes before the system volume snapshot is created.
At the namespace level, it creates a snapshot for a specific sandbox and records the snapshot status, ID, retention duration, and other information.
It describes parameters related to snapshot creation and the snapshot deletion policy.
Data volumes can be mounted on NAS. This allows users to share data across multiple sandboxes.
Data generated during the sandbox lifecycle can be stored in persistent storage (PV and PVC). After a Pod is deleted and recreated, the data from the PVC can still be mounted into the container. The Sandbox CRD defines a volumeClaimTemplates template, which allows users to specify the accessmode, storage size, and storageClassName of the Volume. This is similar to the way the StatefulSet CRD is used.
The data retention policy for data volumes is determined by the retention policy of the Volume:
- Retain: After the PVC is released, the PV remains Released and is not automatically deleted or reclaimed.
- Delete: After the PVC is released, the PV and its underlying storage resources are automatically deleted.
- Recycle: After the PVC is released, the PV is reclaimed into the unbound PV pool and can be reused by other PVCs.