Skip to content

Latest commit

 

History

History
150 lines (103 loc) · 6.51 KB

README.md

File metadata and controls

150 lines (103 loc) · 6.51 KB

Qdrant Vector Database on Azure Cloud

This project provides resources to deploy the Qdrant vector database on Azure using Azure Kubernetes Service (AKS) with Helm (custom chart w/qdrant helm dependency).

Prerequisites

To get started, users will need access to an Azure subscription. Users will also need to have the following installed on their local machine:

  • Helm: Helm can be installed via package manager or with the Helm script for bash shell provided in folder scripts in this directory. To install Helm using script run the following command:

    chmod 700 get_helm.sh 
    ./get_helm.sh

    Alternatively, helm can be installed via various package managers for Windows and/or MacOs by following the instructions note in the Helm documentation.

    Documentation Example: Install Helm on Windows with Powershell

    choco install kubernetes-helm
  • Kubectl: Tools for Kubernetes will need to installed. You install kubectl using the Azure CLI by executing the az aks install-cli command. Alternatively, following the instruction in the Kubernetes documentation to install kubectl.

As a convenience, a kubectl install script is provided in the scripts folder in this directory.

If using the Visual Studio Code dev container, both Helm and Kubectl are installed as features of the dev container.

Getting Started

You can get started by using the Deploy the Azure button shown below.

This solution contains both an Azure Bicep and an ARM template. The Deploy to Azure button uses the ARM template. To use the Bicep template, please follow the instructions below for using the Azure CLI or Azure PowerShell.

Deployment

To deploy the Qdrant service on Azure Kubernetes Service with an Azure volume, you must first ensure that the AKS cluster is running. You can create a cluster using the Deploy to Azure button below, or manually using the Azure Portal or Azure CLI.

Prerequisites

Before selecting the Deploy to Azure button, please ensure that a resource group and a SSH key for Azure has been created. You can create both by running the commands shown below in the Azure CLI or by using the Azure Portal.

az group create --name <YOUR_RESOURCE_GROUP_NAME> --location eastus

az sshkey create --name "qdrantSSHKey" --resource-group "<YOUR_RESOURCE_GROUP_NAME_CREATED_ABOVE>"

OR

You can also create and upload an SSH key manually by following these steps: A key can be generated using the ssh-keygen command, as shown in the example below.

ssh-keygen -t rsa -b 4096

When prompted, provide the following values:

  • Linux admin username: Enter a username to connect using SSH, such as azurek8sadmin.
  • SSH RSA public key: copy and paste the public part of your SSH key pair (by default, the contents of ~/.ssh/id_rsa.pub).

PLEASE NOTE: Upon clicking Deploy to Azure button below and loading template, please select 'Use existing SSH key' option and from the dropdown select the SSH key created in Azure created above (key name in example above is qdrantSSHKey)

OR if you generated a key manually, select option to Provide an SSH Key and paste the key in full into the textbox.

Deploy to Azure

Azure CLI

To create an AKS cluster using the Azure CLI, open the command line and run the following command:

  az deployment group create \
  --name ExampleDeployment \
  --resource-group ExampleGroup \
  --template-file main.bicep \
Azure PowerShell

To deploy using the Azure Powershell, open the Powershell command line and run the following command:

   New-AzResourceGroupDeployment `
      -Name remoteTemplateDeployment `
      -ResourceGroupName ExampleGroup `
      -TemplateFile main.bicep

Installation

After the AKS cluster has been created, you can deploy Qdrant on Azure Kubernetes Service with Helm. Go to the qdrant-on-azure folder which contains the Helm chart for Qdrant and run the following commands:

  1. Configure kubectl to connect to your Kubernetes cluster using the az aks get-credentials command:

    az aks get-credentials --resource-group <your-resource-group-name> --name <your-aks-cluster-name>

    Once you have configured kubectl with credential, you can verify the nodes are running successfully by running the following command:

    kubectl get nodes
  2. From the current directory (Azure-Kubernetes-Svc/qdrant-on-azure), install Qdrant on Azure Kubernetes Service with Helm by running the following command: NOTE: For more information on Helm, Helm commands and related parameters, see Helm documentation linked below

    helm install <your desired installation name> ./qdrant-on-azure --create-namespace

    OR for custom namespace

    helm install <your installation name> ../qdrant-on-azure --namespace <your desired namespace> --create-namespace
  3. If you wish to verify your installation, Create a collection in Qdrant, as shown in the Qdrant quick start documentation.

Note: Your load balancer public IP address can be found by running the command: kubectl get services and copying the IP address from the EXTERNAL-IP column for TYPE LoadBalancer. Qdrant LB IP Addr

```bash
curl -X PUT 'http://[YOUR-LOAD-BALANCER-PUBLIC-IP-ADDRESS]:6333/collections/test_collection' \
-H 'Content-Type: application/json' \
--data-raw '{
    "vectors": {
        "size": 4,
        "distance": "Dot"
    }
}'
```

If you wish to verify the test collection was created, run the following command.

```bash
curl 'http://[YOUR-LOAD-BALANCER-PUBLIC-IP-ADDRESS]:6333/collections/test_collection'
```

Resources to Learn More