diff --git a/.github/workflows/pr-workflow.yaml b/.github/workflows/pr-workflow.yaml index a7a03dd..fdb2001 100644 --- a/.github/workflows/pr-workflow.yaml +++ b/.github/workflows/pr-workflow.yaml @@ -11,8 +11,27 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 + with: + fetch-depth: 0 - - name: Run helm lint - shell: bash - run: | - helm lint + - name: Set up Helm + uses: azure/setup-helm@v3 + with: + version: v3.12.1 + + - uses: actions/setup-python@v4 + with: + python-version: '3.9' + check-latest: true + + - name: Set up chart-testing + uses: helm/chart-testing-action@v2.4.0 + + - name: Run chart-testing (lint) + run: ct lint --all + + - name: Create kind cluster + uses: helm/kind-action@v1.8.0 + + - name: Run chart-testing (install) + run: ct install --all diff --git a/.github/workflows/release-workflow.yaml b/.github/workflows/release-workflow.yaml index cf3cc3a..6e5c72d 100644 --- a/.github/workflows/release-workflow.yaml +++ b/.github/workflows/release-workflow.yaml @@ -2,57 +2,45 @@ name: Release on: push: branches: - - 'releases/**' + - main jobs: Release: name: Release Workflow runs-on: ubuntu-latest + permissions: + contents: write steps: - name: Checkout uses: actions/checkout@v3 + with: + fetch-depth: 0 - - name: Check if version exists - shell: bash + - name: Configure Git run: | - if [ $(curl -I https://github.com/qdrant/qdrant-helm/blob/gh-pages/qdrant-${GITHUB_REF##*/}.tgz 2>/dev/null | head -n 1 | cut -d$' ' -f2) = "200" ] - then - exit 1 - fi + git config user.name "ghrunnerbot" + git config user.email "cloud-dev@qdrant.com" - - name: Run helm lint - shell: bash - run: | - helm lint - - - name: Tag Release Commit - shell: bash - run: | - git tag ${GITHUB_REF##*/} - git push origin ${GITHUB_REF##*/} - - - name: Helm Package - shell: bash - run: | - helm package . - mv qdrant-*.tgz ../../ + - name: Run chart-releaser + uses: helm/chart-releaser-action@v1.5.0 + env: + CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - name: Checkout to gh-pages uses: actions/checkout@v3 with: ref: gh-pages - - name: Move Package to gh-pages & Helm Repo Index - shell: bash - run: | - mv ../../qdrant-*.tgz . - helm repo index . --url https://qdrant.github.io/qdrant-helm/ + - name: Setup Go + uses: actions/setup-go@v2 + with: + go-version: 1.17 - - name: Push to gh-pages - shell: bash + - name: Generate index.html run: | - git config --global user.name 'ghrunnerbot' - git config --global user.email 'cloud-dev@qdrant.com' - git add qdrant-*.tgz index.yaml - git commit -m "version upgrade" - git push + go install github.com/halkeye/helm-repo-html@v0.2.0 + /home/runner/go/bin/helm-repo-html + + - uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: "Update index.html" diff --git a/Chart.yaml b/Chart.yaml deleted file mode 100644 index 5ec88b9..0000000 --- a/Chart.yaml +++ /dev/null @@ -1,24 +0,0 @@ -apiVersion: v2 -name: qdrant -description: A Helm chart for Kubernetes - -# A chart can be either an 'application' or a 'library' chart. -# -# Application charts are a collection of templates that can be packaged into versioned archives -# to be deployed. -# -# Library charts provide useful utilities or functions for the chart developer. They're included as -# a dependency of application charts to inject those utilities and functions into the rendering -# pipeline. Library charts do not define any templates and therefore cannot be deployed. -type: application - -# This is the chart version. This version number should be incremented each time you make changes -# to the chart and its templates, including the app version. -# Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.2.10 - -# This is the version number of the application being deployed. This version number should be -# incremented each time you make changes to the application. Versions are not expected to -# follow Semantic Versioning. They should reflect the version the application is using. -# It is recommended to use it with quotes. -appVersion: "latest" diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..f49a4e1 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/README.md b/README.md index 6b3de3e..849c144 100644 --- a/README.md +++ b/README.md @@ -1,86 +1,13 @@ -# Qdrant helm chart +# Qdrant helm repository [Qdrant documentation](https://qdrant.tech/documentation/) -## Disclaimer +This repository hosts the following helm charts: -For production use cases, please pin the version of the qdrant image in the values.yaml file to a specific version instead of latest +* [Qdrant](charts/qdrant/README.md) -## TLDR +## Usage ```bash helm repo add qdrant https://qdrant.github.io/qdrant-helm -helm repo update -helm install your-qdrant-installation-name qdrant/qdrant ``` - -## Description - -This chart installs and bootstraps a Qdrant instance. - -## Prerequisites - -- Kubernetes -- Helm -- PV provisioner (by the infrastructure) - -## Installation & Setup - -You can install the chart via: - -```bash -helm install your-qdrant-installation-name . -``` - -To install a specific version of the qdrant image - -```bash -helm install your-qdrant-installation-name . --set image.tag=v0.9.0 -``` - -DISCLAIMER: This could lead to unexpected behaviour depending on chart version vs Qdrant image version - -Unistall via: - -```bash -helm delete your-qdrant-installation-name . -``` - -Delete the volume with - -```bash -kubectl delete pvc -l app.kubernetes.io/instance=your-qdrant-installation-name -``` - -## Configuration - -For documentation of the settings please refer to [Qdrant Configuration File](https://github.com/qdrant/qdrant/blob/master/config/config.yaml) -All of these configuration options could be overwritten under config in `values.yaml`. -A modifcation example is provided there. - -### Distributed setup - -Running a distributed cluster just needs a few changes in your `values.yaml` file. -Increase the number of replicas to the desired number of nodes and set `config.cluster.enabled` to true. - -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. - -Example EBS pv, pvc and volume creation command is added in examples directory -Note: Make sure volume is on the same region and availability zone as where qdrant is going to be installed. - -### Metrics endpoints - -Metrics are availables on rest api (default port set to 6333) at `/metrics` - -Refer to [qdrant metrics configuration](https://qdrant.tech/documentation/telemetry/#metrics) for more information - -### Enable rolling update on configuration change - -To enable rolling update on config map modification set `updateConfigurationOnChange` to true diff --git a/.helmignore b/charts/qdrant/.helmignore similarity index 100% rename from .helmignore rename to charts/qdrant/.helmignore diff --git a/charts/qdrant/Chart.yaml b/charts/qdrant/Chart.yaml new file mode 100644 index 0000000..0dabc3e --- /dev/null +++ b/charts/qdrant/Chart.yaml @@ -0,0 +1,17 @@ +apiVersion: v2 +name: qdrant +description: Qdrant - Vector Database for the next generation of AI applications. +home: https://qdrant.tech +sources: + - https://github.com/qdrant/qdrant + - https://github.com/qdrant/qdrant-helm +keywords: + - vector database +maintainers: + - name: qdrant + email: info@qdrant.com + url: https://github.com/qdrant +icon: https://qdrant.github.io/qdrant-helm/logo_with_text.svg +type: application +version: 0.3.0 +appVersion: v1.4.1 diff --git a/charts/qdrant/README.md b/charts/qdrant/README.md new file mode 100644 index 0000000..95d27aa --- /dev/null +++ b/charts/qdrant/README.md @@ -0,0 +1,74 @@ +# Qdrant helm chart + +[Qdrant documentation](https://qdrant.tech/documentation/) + +## TLDR + +```bash +helm repo add qdrant https://qdrant.github.io/qdrant-helm +helm repo update +helm install your-qdrant-installation-name qdrant/qdrant +``` + +## Description + +This chart installs and bootstraps a Qdrant instance. + +## Prerequisites + +- Kubernetes +- Helm +- PV provisioner (by the infrastructure) + +## Installation & Setup + +You can install the chart via: + +```bash +helm install your-qdrant-installation-name . +``` + +Uninstall via: + +```bash +helm delete your-qdrant-installation-name +``` + +Delete the volume with + +```bash +kubectl delete pvc -l app.kubernetes.io/instance=your-qdrant-installation-name +``` + +## Configuration + +For documentation of the settings please refer to [Qdrant Configuration File](https://github.com/qdrant/qdrant/blob/master/config/config.yaml) +All of these configuration options could be overwritten under config in `values.yaml`. +A modification example is provided there. + +### Distributed setup + +Running a distributed cluster just needs a few changes in your `values.yaml` file. +Increase the number of replicas to the desired number of nodes and set `config.cluster.enabled` to true. + +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. + +Example EBS pv, pvc and volume creation command is added in examples directory +Note: Make sure volume is on the same region and availability zone as where qdrant is going to be installed. + +### Metrics endpoints + +Metrics are available through rest api (default port set to 6333) at `/metrics` + +Refer to [qdrant metrics configuration](https://qdrant.tech/documentation/telemetry/#metrics) for more information. + +### Enable rolling update on configuration change + +To enable rolling update on config map modification set `updateConfigurationOnChange` to true. diff --git a/templates/NOTES.txt b/charts/qdrant/templates/NOTES.txt similarity index 58% rename from templates/NOTES.txt rename to charts/qdrant/templates/NOTES.txt index 86308df..450736c 100644 --- a/templates/NOTES.txt +++ b/charts/qdrant/templates/NOTES.txt @@ -1,3 +1,7 @@ +Qdrant {{ .Chart.AppVersion }} has been deployed successfully. + +The full Qdrant documentation is available at https://qdrant.tech/documentation/. + To forward Qdrant's ports execute one of the following commands: export POD_NAME=$(kubectl get pods --namespace {{ $.Release.Namespace }} -l "app.kubernetes.io/name={{ include "qdrant.name" . }},app.kubernetes.io/instance={{ $.Release.Name }}" -o jsonpath="{.items[0].metadata.name}") @@ -8,3 +12,13 @@ If you want to use Qdrant via {{ .name }} execute the following commands kubectl --namespace {{ $.Release.Namespace }} port-forward $POD_NAME {{ .targetPort }}:{{ .targetPort }} {{- end }} {{- end }} + +{{- if .Values.ingress.enabled }} + +If you want to access Qdrant through the ingress controller +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} + {{- end }} +{{- end }} +{{- end }} diff --git a/templates/_helpers.tpl b/charts/qdrant/templates/_helpers.tpl similarity index 100% rename from templates/_helpers.tpl rename to charts/qdrant/templates/_helpers.tpl diff --git a/templates/configmap.yaml b/charts/qdrant/templates/configmap.yaml similarity index 100% rename from templates/configmap.yaml rename to charts/qdrant/templates/configmap.yaml diff --git a/templates/ingress.yaml b/charts/qdrant/templates/ingress.yaml similarity index 92% rename from templates/ingress.yaml rename to charts/qdrant/templates/ingress.yaml index 0693174..457bf82 100644 --- a/templates/ingress.yaml +++ b/charts/qdrant/templates/ingress.yaml @@ -27,13 +27,15 @@ spec: {{- end }} {{- end }} {{- end }} - {{- with .Values.ingress.tls }} + {{- if .Values.ingress.tls }} tls: + {{- range .Values.ingress.tls}} - hosts: {{- range .hosts }} - {{ . | quote }} {{- end }} secretName: {{ .secretName | quote }} + {{- end }} {{- end }} {{- end }} diff --git a/templates/service-headless.yaml b/charts/qdrant/templates/service-headless.yaml similarity index 100% rename from templates/service-headless.yaml rename to charts/qdrant/templates/service-headless.yaml diff --git a/templates/service.yaml b/charts/qdrant/templates/service.yaml similarity index 100% rename from templates/service.yaml rename to charts/qdrant/templates/service.yaml diff --git a/templates/servicemonitor.yaml b/charts/qdrant/templates/servicemonitor.yaml similarity index 87% rename from templates/servicemonitor.yaml rename to charts/qdrant/templates/servicemonitor.yaml index 900f953..bd7e81e 100644 --- a/templates/servicemonitor.yaml +++ b/charts/qdrant/templates/servicemonitor.yaml @@ -1,4 +1,4 @@ -{{- if and (.Values.metrics.enabled) (.Values.metrics.serviceMonitor.enabled)}} +{{- if .Values.metrics.serviceMonitor.enabled }} kind: ServiceMonitor apiVersion: monitoring.coreos.com/v1 metadata: diff --git a/templates/statefulset.yaml b/charts/qdrant/templates/statefulset.yaml similarity index 100% rename from templates/statefulset.yaml rename to charts/qdrant/templates/statefulset.yaml diff --git a/charts/qdrant/templates/tests/test-connection.yaml b/charts/qdrant/templates/tests/test-connection.yaml new file mode 100644 index 0000000..faf37c8 --- /dev/null +++ b/charts/qdrant/templates/tests/test-connection.yaml @@ -0,0 +1,19 @@ +{{- $root := . }} +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "qdrant.fullname" . }}-test-connection" + labels: + {{- include "qdrant.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test +spec: + containers: + {{- range .Values.service.ports }} + {{- if eq .name "http"}} + - name: curl + image: curlimages/curl + args: ['http://{{ include "qdrant.fullname" $root }}:{{ .port }}'] + {{- end }} + {{- end}} + restartPolicy: Never diff --git a/values.yaml b/charts/qdrant/values.yaml similarity index 91% rename from values.yaml rename to charts/qdrant/values.yaml index 8bba70b..8b4c873 100644 --- a/values.yaml +++ b/charts/qdrant/values.yaml @@ -3,7 +3,7 @@ replicaCount: 1 image: repository: qdrant/qdrant pullPolicy: IfNotPresent - tag: latest + tag: "" imagePullSecrets: [] nameOverride: "" @@ -43,9 +43,9 @@ ingress: pathType: Prefix servicePort: 6333 tls: [] - #- hosts: + # - hosts: # - example-domain.com - # secretName: tls-secret-name + # secretName: tls-secret-name livenessProbe: enabled: true @@ -91,16 +91,16 @@ affinity: {} persistence: accessModes: ["ReadWriteOnce"] size: 10Gi - #storageClassName: local-path + # storageClassName: local-path -#only supported for single node qdrant clusters. +# only supported for single node qdrant clusters. snapshotRestoration: enabled: false 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 +# modification example for configuration to overwrite defaults config: cluster: enabled: true @@ -129,7 +129,6 @@ sidecarContainers: [] updateConfigurationOnChange: false metrics: - enabled: false serviceMonitor: enabled: false scrapeInterval: 30s