Restore Persistent Volume trên Kubernetes
Tính năng restore volume cho phép restore dữ liệu Persistent Volume (PV) từ snapshot có sẵn. Quy trình hoàn toàn native trên Kubernetes: cấu hình 1 PVC dựa trên snapshot có sẵn, sau đó trỏ cấu hình PVC hoặc volumeMount của ứng dụng sang PVC vừa tạo. Xem tài liệu Kubernetes về volume PVC data source để biết thêm.
Restore volume từ snapshot
Cấu hình và apply file YAML của PVC, tham chiếu snapshot làm data source:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: <new-pvc-name>
namespace: <namespace>
spec:
dataSource:
name: new-snapshot-test
kind: VolumeSnapshot
apiGroup: snapshot.storage.k8s.io
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 20Gi
Sau khi apply, cấu hình PVC này trong ứng dụng theo nhu cầu.