Skip to content

Commit

Permalink
Add support for qdrant recovery mode (#54)
Browse files Browse the repository at this point in the history
* Add support for qdrant recovery mode by adding environment variables support to helm template as well as starting qdrant from `entrypoint.sh`.

* Fix indentation;

* Fix indentation

* More indentation fixes

---------

Co-authored-by: Tony Skorik <anton.skorik@aliexpress.ru>
  • Loading branch information
TonySkorik and Tony Skorik authored Aug 30, 2023
1 parent f9ebbaa commit e705e6a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
6 changes: 3 additions & 3 deletions charts/qdrant/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ data:
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 }}
./entrypoint.sh {{ 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'
./entrypoint.sh --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'
./entrypoint.sh --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: |
Expand Down
5 changes: 5 additions & 0 deletions charts/qdrant/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ spec:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
{{- range .Values.env }}
- name: {{ .name }}
value: {{ .value | quote }}
{{- end }}
command: ["/bin/sh", "-c"]
{{- with .Values.args }}
args:
Expand Down
3 changes: 3 additions & 0 deletions charts/qdrant/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
args: ["./config/initialize.sh"]
env: {}
# - name: QDRANT_ALLOW_RECOVERY_MODE
# value: true

# checks - Readiness and liveness checks can only be enabled for either http (REST) or grpc (multiple checks not supported)
# grpc checks are only available from k8s 1.24+ so as of per default we check http
Expand Down

0 comments on commit e705e6a

Please sign in to comment.