July 22, 2024
Instructions for restoring data using Longhorn backup and restore features.
Scale Down the PostgreSQL StatefulSet:
kubectl scale statefulset.apps/postgresql --replicas=0 -n postgresql
Wait for the Volume to Detach:
Note the Current Volume Name:
pvc-1be4dafb-399f-40d4-ac87-205eb56c2f44
.Delete the Old Volume via Longhorn GUI:
Restore the Backup to a New Volume:
pvc-1be4dafb-399f-40d4-ac87-205eb56c2f44
).Wait for the Restore Process to Complete:
Create Persistent Volume (PV) / Persistent Volume Claim (PVC):
pvc-1be4dafb-399f-40d4-ac87-205eb56c2f44
open operation button > select Create PV/PVC
Create PVC
option is checked.Use Previous PVC
option is checked.Wait for the PV/PVC to be Available:
Scale Up the PostgreSQL StatefulSet:
kubectl scale statefulset.apps/postgresql --replicas=1 -n postgresql
By following these steps, you can successfully restore your data using Longhorn.