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

Persistent volume deletion on deployment deletion #1433

Open
jurisitsm opened this issue Oct 11, 2023 · 3 comments
Open

Persistent volume deletion on deployment deletion #1433

jurisitsm opened this issue Oct 11, 2023 · 3 comments

Comments

@jurisitsm
Copy link

I am encountering an issue when deploying ArangoDB using the Kubernetes Operator in Rancher. When I delete the ArangoDB chart in Rancher, the associated Persistent Volume is also deleted, despite having a StorageClass with a reclaim policy set to "Retain." This behavior is causing data loss.

The ArangoDB Operator's handling of finalizers, particularly the "remove-child-finalizers" process, might be relevant to this issue.

Here is the yaml defining the arango deployment in my chart:
apiVersion: database.arangodb.com/v1
kind: ArangoDeployment
metadata:
name: {{ .Values.arangodb.deploymentName }}
labels:
{{- include "labels" . | indent 4 }}
app.kubernetes.io/component: arango
spec:
image: {{ .Values.repository }}/{{ .Values.arangodb.image.name }}:{{ .Values.arangodb.image.version }}
imagePullPolicy: {{ .Values.pullPolicy }}
imagePullSecrets:
- docker-registry-key
annotations:
{{- include "labels" . | indent 4 }}
app.kubernetes.io/component: arango
tls:
caSecretName: None
mode: Single
{{- if .Values.arangodb.nodePort }}
externalAccess:
nodePort: {{ .Values.arangodb.nodePort }}
{{ end }}
single:
resources:
{{- toYaml .Values.arangodb.resources | nindent 6 }}
volumeClaimTemplate:
spec:
storageClassName: arango-storage-class
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 8Gi
volumeMode: Filesystem

And here is the yaml of the storage class definition:
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: arango-storage-class
provisioner: kubernetes.io/aws-ebs
reclaimPolicy: Retain

After installation the storage class gets created, the policy is indeed set to retain, and the arango deployment has it as it's storage class.

@ajanikow
Copy link
Collaborator

ajanikow commented Nov 6, 2023

Hello!

Please, enable the Storage Feature via:

--deployment.feature.local-storage.pass-reclaim-policy   [LocalStorage] Pass ReclaimPolicy from StorageClass instead of using hardcoded Retain - Required version 3.6.0

This feature will be enabled by default in 1.3.0.

Best Regards,
Adam.

@jurisitsm
Copy link
Author

Since this is only one template in a large helm chart, from which our application is installed, I'd like to know if there is a way to enable this feature through the yaml template of the arango deployment, in a similar way:
volumeClaimTemplate:
spec:
storageClassName: arango-storage-class
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 8Gi
volumeMode: Filesystem
args:
- --deployment.feature.local-storage.pass-reclaim-policy
I have found some documentation on the specification of an args array during the installation of the chart, but I've found the option of providing arguments to be a bit ambiguous between several options here: https://github.com/arangodb/kube-arangodb/blob/master/docs/api/ArangoDeployment.V1.md

@ajanikow
Copy link
Collaborator

Hello! It is Operator Command Line arg, which can be set via https://github.com/arangodb/kube-arangodb/blob/master/chart/kube-arangodb/values.yaml#L9

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

No branches or pull requests

2 participants