AI

Install Weaviate in Kubernetes

Weaviate is a decentralized knowledge graph system that uses vector-based representations and advanced algorithms to efficiently store, search, and retrieve the information from unstructured data. It employs distributed computing and machine learning techniques to enable the semantic search and adaptive learning.

In this tutorial, we will learn how to quickly configure a Weaviate cluster using Kubernetes and Helm charts.

Requirements:

The main essence of this post is setting up Weaviate using Kubernetes. Therefore, we do not cover the installation of Kubernetes or Helm on any operating system. You can check our posts on that to learn more.

Hence, ensure that you meet the following features:

  1. A Kubernetes cluster version 1.23 and above
  2. Cluster support for PersistentVolumes through PersistentVolumeClaims
  3. Helm version 16.4 and above

With the above requirements met, we can proceed to the installation process.

Download the Helm Chart

The first step is to add the Weaviate repository to Helm. This repository contains the Weaviate Helm chart which we will use to configure the Weaviate cluster.

$ helm repo add weaviate https://weaviate.github.io/weaviate-helm

Once we added the repository, use the “show” command to get the default “values.yaml” configuration file from the Helm chart.

$ helm show values weaviate/weaviate > values.yaml

This should download the default configuration and save it to the “values.yaml” file.

Modify the Configuration

Once downloaded, open the file with your chosen text editor and make the necessary changes.

By default, the configuration file creates a Weaviate cluster with one replica. The number of replicas cannot be modified when writing this tutorial.

It also provides the “text2vec-contextionary”, “text2vec-transformers”, “qna-transformers”, and “img2vect-neural” modules. However, they are disabled by default. Hence, you must manually enable them in the configuration file.

Enable the Authentication

To secure the Weavite cluster, you can enable the authentication and configure the users and their respective credentials. Ensure to configure the values in this block accurately as they determine the authentication capabilities of the cluster.

An example configuration is as follows:

Create the Kubernetes Namespace

Once you are satisfied with the configuration, save the file and proceed to the next step to deploy the cluster.

Start by creating a Kubernetes namespace for Weaviate as shown in the following command:

$ kubectl create namespace weaviate

This should configure a new namespace with the specified name.

Install the Helm Chart

Finally, you can start the Weaviate cluster using Helm to deploy the k8s as shown in the following commands:

$ helm upgrade --install "weaviate" weaviate/weaviate --namespace "weaviate" --values .\values.yaml

The previous command uses Helm to initialize the cluster using the values that are provided in the “values.yaml” file.

Example Output:

Release “weaviate” does not exist. Installing it now.

NAME: weaviate

LAST DEPLOYED: Sun Jul 9 08:07:10 2023

NAMESPACE: weaviate

STATUS: deployed

REVISION: 1

TEST SUITE: None

Conclusion

You discovered how you can use Kubernetes and Helm to run a Weaviate cluster on your local machine. Feel free to explore the docs for more details.

About the author

John Otieno

My name is John and am a fellow geek like you. I am passionate about all things computers from Hardware, Operating systems to Programming. My dream is to share my knowledge with the world and help out fellow geeks. Follow my content by subscribing to LinuxHint mailing list