Description
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.