Local Kuberntes

We reccomend using kind

Clone the Trieve repository

git clone https://github.com/devflowinc/trieve.git

Create a kind cluster with a local image registry


./scripts/kind-with-registry.sh

Install Trieve Dependencies

Trieve depends on the following:

To install these dependencies, run the following commands:

# Must apply twice for CRD's to be created
kubectl apply -f ./helm/test
kubectl apply -f ./helm/test
# Install qdrant
helm repo add qdrant https://qdrant.github.io/qdrant-helm
helm repo update
helm upgrade -i qdrant qdrant/qdrant --set apiKey="qdrant-api-key"

Verify all Dependencies are installed.

It may take a while for all resources to be available, kind is typically a bit slower than a production cluster.

To verify the installation is correct run kubectl get all and verify the output matches that below.

Easiest way to do this is run

watch kubectl get all
NAME                                       READY   STATUS      RESTARTS   AGE
pod/chi-trieve-clickhouse-cluster1-0-0-0   1/1     Running     0          30m
pod/keycloak-operator-5d45b88d94-kclw2     1/1     Running     0          31m
pod/keycloak-postgres-0                    1/1     Running     0          31m
pod/postgresql-db-0                        1/1     Running     0          31m
pod/qdrant-0                               1/1     Running     0          22s
pod/redis-68d8d5bddf-4p5df                 1/1     Running     0          31m
pod/trieve-keycloak-0                      1/1     Running     0          6m51s
pod/trieve-realm-xv7hp                     0/1     Completed   0          7m2s

NAME                                         TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)                      AGE
service/chi-trieve-clickhouse-cluster1-0-0   ClusterIP   None            <none>        9000/TCP,8123/TCP,9009/TCP   30m
service/clickhouse-trieve-clickhouse         ClusterIP   None            <none>        8123/TCP,9000/TCP            30m
service/keycloak-operator                    ClusterIP   10.96.152.103   <none>        80/TCP                       31m
service/keycloak-postgres                    ClusterIP   10.96.214.23    <none>        5432/TCP                     31m
service/kubernetes                           ClusterIP   10.96.0.1       <none>        443/TCP                      31m
service/postgres                             ClusterIP   10.96.217.15    <none>        5432/TCP                     31m
service/qdrant                               ClusterIP   10.96.44.173    <none>        6333/TCP,6334/TCP,6335/TCP   22s
service/qdrant-headless                      ClusterIP   None            <none>        6333/TCP,6334/TCP,6335/TCP   22s
service/redis                                ClusterIP   10.96.172.177   <none>        6379/TCP                     31m
service/trieve-keycloak-discovery            ClusterIP   None            <none>        7800/TCP                     7m42s
service/trieve-keycloak-service              ClusterIP   10.96.136.207   <none>        8080/TCP,9000/TCP            7m42s

NAME                                READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/keycloak-operator   1/1     1            1           31m
deployment.apps/redis               1/1     1            1           31m

NAME                                           DESIRED   CURRENT   READY   AGE
replicaset.apps/keycloak-operator-5d45b88d94   1         1         1       31m
replicaset.apps/redis-68d8d5bddf               1         1         1       31m

NAME                                                  READY   AGE
statefulset.apps/chi-trieve-clickhouse-cluster1-0-0   1/1     30m
statefulset.apps/keycloak-postgres                    1/1     31m
statefulset.apps/postgresql-db                        1/1     31m
statefulset.apps/qdrant                               1/1     22s
statefulset.apps/trieve-keycloak                      1/1     7m42s

NAME                     STATUS     COMPLETIONS   DURATION   AGE
job.batch/trieve-realm   Complete   1/1           10s        7m2s

Once your output matches the above, you can move on to the next step.

Install the Trieve helm chart

The helm/values.local.yaml file is preconfigured to work with the dependencies as installed by test/.

Edit any values if needed

helm upgrade -i trieve-local -f helm/values.local.yaml helm/

Verify the installation

After installing, kubectl get deployments should look like this.

NAME                READY   UP-TO-DATE   AVAILABLE   AGE
bktree-worker       1/1     1            1           14m
chat                1/1     1            1           14m
crawl-worker        1/1     1            1           14m
dashboard           1/1     1            1           14m
delete-worker       1/1     1            1           14m
group-worker        1/1     1            1           14m
ingest              10/10   10           10          14m
keycloak-operator   1/1     1            1           46m
redis               1/1     1            1           46m
search              1/1     1            1           14m
server              3/3     1            0           14m
sync-qdrant         0/0     0            0           14m
word-worker         1/1     1            1           14m
  1. Edit /etc/hosts and add the following entries here.
127.0.0.1  api.localtrieve.com
127.0.0.1  search.localtrieve.com
127.0.0.1  dashboard.localtrieve.com
127.0.0.1  chat.localtrieve.com
127.0.0.1  auth.localtrieve.com
127.0.0.1  trieve-keycloak-service

and port-forward keycloak

kubectl port-forward svc/trieve-keycloak-service 8080:8080

Navigate to http://dashboard.localtrieve.com, and make an acocount. (The email does not need to be real).

You should be use everything locally with a local CPU embedding server.