PVC Provisioning, Volume Snapshot, and Restore
Objectives
- Create PVC-backed stateful application (PostgreSQL); snapshot; restore from backup.
Prerequisites
VCF lab environment deployed and operational
Lab Environment
Standard VCF lab environment for Advanced VCF 9.0 VKS (vSphere Kubernetes Service)
Tasks
Task 1 PVC Provisioning, Volume Snapshot, and Restore
Create PVC-backed stateful application (PostgreSQL); snapshot; restore from backup.
Deploy PostgreSQL StatefulSet with PVC using vsan-default StorageClass.
Create database: kubectl exec -it postgres-0 -- psql -c "CREATE TABLE test (id INT, data TEXT);"
Insert test data: INSERT INTO test VALUES (1, 'production-critical-data');
Create VolumeSnapshot: kubectl apply -f pg-snapshot.yaml
Verify snapshot created in vSAN: vsan-cli snapshot list | grep postgres
Simulate disaster: kubectl delete pvc postgres-data-postgres-0
Restore from snapshot: Create new PVC with dataSource pointing to snapshot.
Verify data restored: kubectl exec -it postgres-0 -- psql -c "SELECT * FROM test;" Confirm original data present.
Document RPO/RTO: Snapshot creation time, restore duration, impact on application SLA.
Validation Gate
Check: Verify lab completion
Expected: Lab exercise completed successfully
Common Errors
Final Validation
Lab completed successfully
✓ All steps completed → No errors observed
Cleanup / Restore
• Revert to snapshot if needed
Design Reflection (VCDX)
Persistent storage design for Kubernetes on VCF shows full-stack understanding. VCDX panelists test storage class mapping to vSAN policies, snapshot consistency, and capacity planning.