-
Notifications
You must be signed in to change notification settings - Fork 24
Qdrant: add helm charts #334
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
Changes from all commits
d3ae212
4d69593
c94d333
4adad9a
f00027b
766e4d7
6d1aed6
17b5399
c2e3893
7856769
d5b7479
3303bcc
7b2814d
a5c2ae7
ba0fdec
34f82d7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| {{- if .Values.qdrant.enabled -}} | ||
| apiVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| name: {{ .Values.qdrant.name }} | ||
| labels: | ||
| deploy: sourcegraph | ||
| app.kubernetes.io/component: qdrant | ||
| data: | ||
| config.yaml: | | ||
| debug: {{ .Values.qdrant.config.debug }} | ||
| log_level: {{ .Values.qdrant.config.log_level }} | ||
| storage: | ||
| storage_path: /data | ||
| snapshots_path: /data/storage | ||
| on_disk_payload: true | ||
| service: | ||
| http_port: 6333 | ||
| grpc_port: 6334 | ||
| telemetry_disabled: true | ||
| # The following parameters can be configured | ||
| # on a per-collection basis, so these are just defaults. | ||
| performance: | ||
| max_optimization_threads: 4 | ||
| optimizers: | ||
| max_optimization_threads: 4 | ||
| mmap_threshold_kb: 1 | ||
| indexing_threshold_kb: 0 # disable indexing | ||
| hnsw_index: | ||
| m: 8 | ||
| ef_construct: 100 | ||
| full_scan_threshold: 10 | ||
| max_indexing_threads: 4 | ||
| on_disk: true | ||
| payload_m: 8 | ||
| {{- end }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| {{- if .Values.qdrant.enabled -}} | ||
| apiVersion: v1 | ||
| kind: PersistentVolumeClaim | ||
| metadata: | ||
| labels: | ||
| deploy: sourcegraph | ||
| app.kubernetes.io/component: qdrant | ||
| name: qdrant | ||
| spec: | ||
| accessModes: | ||
| - ReadWriteOnce | ||
| resources: | ||
| requests: | ||
| storage: {{ .Values.qdrant.storageSize }} | ||
| storageClassName: {{ .Values.storageClass.name }} | ||
| {{- if .Values.qdrant.volumeName }} | ||
| volumeName: {{ .Values.qdrant.volumeName }} | ||
| {{- end }} | ||
| {{- end }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| {{- if .Values.qdrant.enabled -}} | ||
| apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| annotations: | ||
| sourcegraph.prometheus/scrape: "true" | ||
| prometheus.io/port: "6333" | ||
| {{- if .Values.qdrant.serviceAnnotations }} | ||
| {{- toYaml .Values.qdrant.serviceAnnotations | nindent 4 }} | ||
| {{- end }} | ||
| labels: | ||
| app: qdrant | ||
| deploy: sourcegraph | ||
| app.kubernetes.io/component: qdrant | ||
| {{- if .Values.qdrant.serviceLabels }} | ||
| {{- toYaml .Values.qdrant.serviceLabels | nindent 4 }} | ||
| {{- end }} | ||
| name: qdrant | ||
| spec: | ||
| ports: | ||
| - name: http | ||
| port: 6333 | ||
| targetPort: http | ||
| - name: grpc | ||
| port: 6334 | ||
| targetPort: grpc | ||
| selector: | ||
| {{- include "sourcegraph.selectorLabels" . | nindent 4 }} | ||
| app: qdrant | ||
| type: {{ .Values.qdrant.serviceType | default "ClusterIP" }} | ||
| {{- end }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| {{- if and .Values.qdrant.enabled .Values.qdrant.serviceAccount.create -}} | ||
| apiVersion: v1 | ||
| kind: ServiceAccount | ||
| metadata: | ||
| labels: | ||
| category: rbac | ||
| deploy: sourcegraph | ||
| app.kubernetes.io/component: {{ .Values.qdrant.name }} | ||
| {{- include "sourcegraph.serviceAccountAnnotations" (list . "qdrant") | trim | nindent 2 }} | ||
| name: {{ include "sourcegraph.serviceAccountName" (list . "qdrant") }} | ||
| {{- end }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,125 @@ | ||
| {{- if .Values.qdrant.enabled -}} | ||
| apiVersion: apps/v1 | ||
| kind: StatefulSet | ||
| metadata: | ||
| name: {{ .Values.qdrant.name }} | ||
| annotations: | ||
| description: Backend for vector search operations. | ||
| labels: | ||
| {{- include "sourcegraph.labels" . | nindent 4 }} | ||
| {{- if .Values.qdrant.labels }} | ||
| {{- toYaml .Values.qdrant.labels | nindent 4 }} | ||
| {{- end }} | ||
| deploy: sourcegraph | ||
| app.kubernetes.io/component: qdrant | ||
| spec: | ||
| minReadySeconds: 10 | ||
| replicas: 1 | ||
| revisionHistoryLimit: {{ .Values.sourcegraph.revisionHistoryLimit }} | ||
| selector: | ||
| matchLabels: | ||
| {{- include "sourcegraph.selectorLabels" . | nindent 6 }} | ||
| app: {{ .Values.qdrant.name }} | ||
| strategy: | ||
| type: Recreate | ||
| template: | ||
| metadata: | ||
| annotations: | ||
| kubectl.kubernetes.io/default-container: qdrant | ||
| {{- if .Values.sourcegraph.podAnnotations }} | ||
| {{- toYaml .Values.sourcegraph.podAnnotations | nindent 8 }} | ||
| {{- end }} | ||
| {{- if .Values.qdrant.podAnnotations }} | ||
| {{- toYaml .Values.qdrant.podAnnotations | nindent 8 }} | ||
| {{- end }} | ||
| labels: | ||
| {{- include "sourcegraph.selectorLabels" . | nindent 8 }} | ||
| {{- if .Values.sourcegraph.podLabels }} | ||
| {{- toYaml .Values.sourcegraph.podLabels | nindent 8 }} | ||
| {{- end }} | ||
| {{- if .Values.qdrant.podLabels }} | ||
| {{- toYaml .Values.qdrant.podLabels | nindent 8 }} | ||
| {{- end }} | ||
| app: {{ .Values.qdrant.name }} | ||
| app.kubernetes.io/component: qdrant | ||
| deploy: sourcegraph | ||
| spec: | ||
| containers: | ||
| - name: {{ .Values.qdrant.name }} | ||
| image: {{ include "sourcegraph.image" (list . "qdrant") }} | ||
| imagePullPolicy: {{ .Values.sourcegraph.image.pullPolicy }} | ||
| terminationMessagePolicy: FallbackToLogsOnError | ||
| env: | ||
| {{- range $name, $item := .Values.qdrant.env }} | ||
| - name: {{ $name }} | ||
| {{- $item | toYaml | nindent 10 }} | ||
| {{- end }} | ||
| ports: | ||
| - containerPort: 6333 | ||
| name: http | ||
| protocol: TCP | ||
| - containerPort: 6334 | ||
| name: grpc | ||
| protocol: TCP | ||
| # TODO: use gRPC liveness/readiness probe once this PR lands: https://github.com/qdrant/qdrant/pull/2409 | ||
| readinessProbe: | ||
| failureThreshold: 3 | ||
| httpGet: | ||
| scheme: HTTP | ||
| port: http | ||
| initialDelaySeconds: 0 | ||
| periodSeconds: 10 | ||
| successThreshold: 1 | ||
| timeoutSeconds: 1 | ||
| livenessProbe: | ||
| failureThreshold: 3 | ||
| httpGet: | ||
| scheme: HTTP | ||
| port: http | ||
| initialDelaySeconds: 0 | ||
| periodSeconds: 10 | ||
| successThreshold: 1 | ||
| timeoutSeconds: 1 | ||
| volumeMounts: | ||
| - name: qdrant-data | ||
| mountPath: /data | ||
| - name: config | ||
| mountPath: /etc/qdrant | ||
| {{- if .Values.qdrant.extraVolumeMounts }} | ||
| {{- toYaml .Values.qdrant.extraVolumeMounts | nindent 8 }} | ||
| {{- end }} | ||
| {{- if not .Values.sourcegraph.localDevMode}} | ||
| resources: | ||
| {{- toYaml .Values.qdrant.resources | nindent 10 }} | ||
| {{- end }} | ||
| securityContext: | ||
| {{- toYaml .Values.qdrant.containerSecurityContext | nindent 10 }} | ||
| {{- if .Values.blobstore.extraContainers }} | ||
| {{- toYaml .Values.blobstore.extraContainers | nindent 6 }} | ||
| {{- end }} | ||
| securityContext: | ||
| {{- toYaml .Values.qdrant.podSecurityContext | nindent 8 }} | ||
| {{- include "sourcegraph.nodeSelector" (list . "qdrant" ) | trim | nindent 6 }} | ||
| {{- include "sourcegraph.affinity" (list . "qdrant" ) | trim | nindent 6 }} | ||
| {{- include "sourcegraph.tolerations" (list . "qdrant" ) | trim | nindent 6 }} | ||
| {{- if .Values.qdrant.serviceAccount.create }} | ||
| serviceAccountName: {{ .Values.qdrant.serviceAccount.name }} | ||
| {{- end}} | ||
| {{- with .Values.sourcegraph.imagePullSecrets }} | ||
| imagePullSecrets: | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| volumes: | ||
| {{- if .Values.qdrant.extraVolumes }} | ||
| {{- toYaml .Values.qdrant.extraVolumes | nindent 6 }} | ||
| {{- end }} | ||
| - name: qdrant-data | ||
| persistentVolumeClaim: | ||
| claimName: qdrant | ||
| - name: config | ||
| configMap: | ||
| name: qdrant | ||
| items: | ||
| - key: config.yaml | ||
| path: config.yaml | ||
| {{- end }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -292,7 +292,7 @@ embeddings: | |
| name: "embeddings" | ||
| # -- Docker image tag for the `embeddings` image | ||
| defaultTag: "5.1.6@sha256:e849f52e38637882e5d2ba3d7d27a656d897c4b4e2905e1fdb843536d9c948ab" | ||
| # -- Resource requests & limits for the `worker` container, | ||
| # -- Resource requests & limits for the `embeddings` container, | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. unrelated, just fixing a couple of typos |
||
| # learn more from the [Kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) | ||
| resources: | ||
| limits: | ||
|
|
@@ -303,7 +303,7 @@ embeddings: | |
| memory: 32G | ||
| # -- Environment variables for the `embeddings` container | ||
| env: {} | ||
| # -- Security context for the `worker` container, | ||
| # -- Security context for the `embeddings` container, | ||
| # learn more from the [Kubernetes documentation](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container) | ||
| containerSecurityContext: | ||
| allowPrivilegeEscalation: false | ||
|
|
@@ -322,6 +322,55 @@ embeddings: | |
| extraVolumeMounts: {} | ||
| extraVolumes: {} | ||
|
|
||
| qdrant: | ||
| # -- Enable `qdrant` | ||
| enabled: false | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Disabled by default, just like embeddings |
||
| # -- Name of the `qdrant` service | ||
| name: qdrant | ||
| image: | ||
| # -- Docker image name for the `embeddings` image | ||
| name: "qdrant" | ||
| # -- Docker image tag for the `embeddings` image | ||
| defaultTag: "239247_2023-08-18_5.1-433e1b1c997f@sha256:eafcd7af2aca699fa9c9ce8e6aa674cc0470441f794baf031296d5d1cdadd0bc" | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pointing to the latest build from main. Should be updated at release. |
||
| # -- Resource requests & limits for the `qdrant` container, | ||
| # learn more from the [Kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) | ||
| config: | ||
| debug: true | ||
| log_level: INFO | ||
| resources: | ||
| limits: | ||
| cpu: "2" | ||
| memory: 8G | ||
| requests: | ||
| cpu: "500m" | ||
| memory: 2G | ||
|
Comment on lines
+341
to
+346
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are there any guidelines for sizing on cloud, other than just "whatever is needed for perf"?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in cloud, we will provide our own override.
generally start small and increase as needed what you put as default here would serve as the recommendation for on-prem customer, not cloud
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. got it, thanks! |
||
| # -- Environment variables for the `qdrant` container | ||
| env: {} | ||
| # -- Security context for the `qdrant` container, | ||
| # learn more from the [Kubernetes documentation](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container) | ||
| containerSecurityContext: | ||
| allowPrivilegeEscalation: false | ||
| runAsUser: 100 | ||
| runAsGroup: 101 | ||
| fsGroup: 101 | ||
| # -- Security context for the `qdrant` container, | ||
| # learn more from the [Kubernetes documentation](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container) | ||
| podSecurityContext: | ||
| runAsUser: 100 | ||
| runAsGroup: 101 | ||
| fsGroup: 101 | ||
| fsGroupChangePolicy: "OnRootMismatch" | ||
| serviceAccount: | ||
| # -- Enable creation of ServiceAccount for `embeddings` | ||
| create: false | ||
| # -- Name of the ServiceAccount to be created or an existing ServiceAccount | ||
| name: "" | ||
| annotations: {} | ||
| extraVolumeMounts: {} | ||
| extraVolumes: {} | ||
| # -- PVC Storage Request for `qdrant` data volume | ||
| storageSize: 100Gi | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How difficult is it to increase the size of a PVC?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like we allow volume expansion by default, but I'm honestly not sure what the ramificaitons are. 100Gi is large enough for a large chunk of customers, but certainly not all.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cloud prefers to start small and scale up as needed (scaling up is easy and we have monitoring for it) |
||
|
|
||
| frontend: | ||
| # -- Environment variables for the `frontend` container | ||
| # @default -- the chart will add some default environment values | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested that these populate metrics in Grafana. I'll need to add a basic dashboard for qdrant