Skip to content

Comments

fix: retain to delete#259

Open
roundspring2003 wants to merge 1 commit intofree5gc:mainfrom
roundspring2003:helm-pvc
Open

fix: retain to delete#259
roundspring2003 wants to merge 1 commit intofree5gc:mainfrom
roundspring2003:helm-pvc

Conversation

@roundspring2003
Copy link
Contributor

Change PersistentVolume Reclaim Policy from Retain to Delete
Problem
When using persistentVolumeReclaimPolicy: Retain, after the PVC is deleted (e.g., during helm uninstall), the PV remains in a Released state and retains a reference (claimRef) to the old PVC. This prevents the PV from being automatically bound to a new PVC on subsequent deployments.

As a result, every time before redeploying, we had to manually run:

kubectl patch pv free5gc-pv-cert --type json -p '[{"op": "remove", "path": "/spec/claimRef"}]'

Solution
Change the reclaim policy to Delete. With this policy:

When the PVC is deleted, the PV will be automatically deleted as well
On the next deployment, a fresh PV will be created and bound to the new PVC
No manual intervention required between deployments
Note
This change is suitable for development and testing environments where data persistence across deployments is not required. For production environments where certificate data must be preserved, Retain policy should be used with proper operational procedures.

@Alonza0314
Copy link
Member

@qawl987 Please help to check it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants