How would be an idiomatic way of restoring PVC to PV maps in a single-node K3s cluster? #13668
|
Hi, Since I'm working with a single-node setup, there is absolutely no need to use cloud-backed PVs, hence early on I decided to use rancher's own local-path provisioner to handle PVCs. So far I've tried: Any advice when it comes to this is appreciated. PS: Also I have considered |
Replies: 2 comments 1 reply
|
As for the rest of the cluster its managed by Flux and Gitops so that side works amazingly. It's only the persistence of volumes which is insanely hard to manage. |
|
Check For a repeatable restore, keep clean PV/PVC manifests: preserve the PV's actual storage source/path and node affinity, set For the already-restored PV, the stale claim reference needs to be cleared before rebinding. Set and verify |
Check
spec.claimRef.uidon the restored PV. A PVC recreated by Flux has a new UID even if its name and namespace are unchanged, so the exported PV may still be reserved for the old claim. That would explain theReleasedstate.For a repeatable restore, keep clean PV/PVC manifests: preserve the PV's actual storage source/path and node affinity, set
persistentVolumeReclaimPolicy: Retain, and set the PVC'sspec.volumeNameto that PV. Reserve the PV withclaimRef.nameandnamespace, without the old claim UID. Don't copy the old object UID, resourceVersion or status. Kubernetes documents pre-binding an existing volume; storage class, access modes and size still have to match. Check that the no…