Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggest to set reclaimPolicy Retain on datadir PV #28

Open
camuffo opened this issue Nov 4, 2024 · 1 comment
Open

Suggest to set reclaimPolicy Retain on datadir PV #28

camuffo opened this issue Nov 4, 2024 · 1 comment
Assignees
Labels
DevOps This label marks this as a DevOps activity

Comments

@camuffo
Copy link
Contributor

camuffo commented Nov 4, 2024

The README should mention that StorageClasses usually provision PVs with reclaimPolicy: Delete.
Suggest to manually patch the reclaimPolicy to be Retain, to preserve valuable data.

kubectl -n gs patch pv PV_NAME -p '{"spec":{"persistentVolumeReclaimPolicy":"Retain"}}'
@camuffo camuffo added the DevOps This label marks this as a DevOps activity label Nov 4, 2024
@camuffo camuffo self-assigned this Nov 4, 2024
@randomorder
Copy link
Member

Hi @camuffo

Please try this instead:

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: my-pvc
  annotations:
    "helm.sh/resource-policy": keep
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 10Gi

the use of annotations to prevent PVC deletion on unistall. Also test what happens on reinstall / upgrade. Do the PVCs reattach to the PODs automatically?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DevOps This label marks this as a DevOps activity
Projects
None yet
Development

No branches or pull requests

2 participants