support single node snapshots restoration

This commit is contained in:
Moustafa Nawar
2022-10-24 20:52:12 +02:00
parent 30a0facac6
commit 4e06afea1a
4 changed files with 23 additions and 0 deletions

View File

@@ -61,3 +61,9 @@ Increase the number of replicas to the desired number of nodes and set `config.c
Depending on your environment or cloud provider you might need to change the service in the `values.yaml` as well.
For example on AWS EKS you would need to change the `cluster.type` to `NodePort`.
### Snapshot Restoration
Disclaimer: Snapshot restoration is only supported for single qdrant node setups
To restore a snapshot create a Persistent Volume and a Persistent Volume Claim using a storage class according to your setup, copy the snapshots to the PV, enable snapshot restoration along with the snapshot file names and pvc name in values.yaml file and run the helm install command.

View File

@@ -6,11 +6,16 @@ data:
initialize.sh: |
#!/bin/sh
SET_INDEX=${HOSTNAME##*-}
{{- if and (.Values.snapshotRestoration.enabled) (eq (.Values.replicaCount | quote) (1 | quote)) }}
echo "Starting initializing for pod $SET_INDEX and snapshots restoration"
./qdrant {{ range .Values.snapshotRestoration.snapshots }} --snapshot {{ . }} {{ end }}
{{- else }}
echo "Starting initializing for pod $SET_INDEX"
if [ "$SET_INDEX" = "0" ]; then
./qdrant --uri 'http://{{ include "qdrant.fullname" . }}-0.{{ include "qdrant.fullname" . }}-headless:6335'
else
./qdrant --bootstrap 'http://{{ include "qdrant.fullname" . }}-0.{{ include "qdrant.fullname" . }}-headless:6335' --uri 'http://{{ include "qdrant.fullname" . }}-'"$SET_INDEX"'.{{ include "qdrant.fullname" . }}-headless:6335'
fi
{{ end }}
production.yaml: |
{{- toYaml .Values.config | nindent 4 }}

View File

@@ -84,6 +84,8 @@ spec:
- name: qdrant-config
mountPath: /qdrant/config/production.yaml
subPath: production.yaml
- name: qdrant-snapshots
mountPath: /qdrant/snapshots
{{- with .Values.nodeSelector }}
nodeSelector:
@@ -102,6 +104,9 @@ spec:
configMap:
name: {{ include "qdrant.fullname" . }}
defaultMode: 0755
- name: qdrant-snapshots
persistentVolumeClaim:
claimName: {{ .Values.snapshotRestoration.pvcName }}
volumeClaimTemplates:
- metadata:

View File

@@ -68,6 +68,13 @@ persistence:
size: 1Gi
#storageClassName: local-path
#only supported for single node qdrant clusters.
snapshotRestoration:
enabled: true
pvcName: snapshots-pvc
snapshots:
- /qdrant/snapshots/test_collection/test_collection-2022-10-24-13-56-50.snapshot:test_collection
#modification example for configuration to overwrite defaults
config:
cluster: