Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions glasskube/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Trieve Glasskube Kubernetes installation


## 1. Start a new minikube cluster

[Minikube](https://minikube.sigs.k8s.io/docs/start/) can be installed via Homebrew or binary downloads.

```shell
minikube start -p trieve
```

## 2. Bootstrap glasskube

[Glasskube](https://glasskube.dev/docs/getting-started/install/) can also be installed via Homebrew or binary downloads.

```shell
glasskube bootstrap
```

## 3. Install trieve dependencies

Make sure you cloned the repository and navigated into the `glasskube/` folder.

```shell
kubectl apply -k dependencies
```

Depending on your API Server, you might need to execute the command multiple times to install all dependencies.

## 4. Install trieve

Feel free to modify the kustomize based configurations as desired.

```shell
kubectl apply -k trieve
```


## 5. Configure local DNS


Receive the IP address of your minikube cluster

```shell
minikube ip -p trieve
```

and make sure to add following entries into your `/etc/hosts` file (make sure you edit this file as root).

```txt
192.168.xxx.x analytics.localtrieve.com
192.168.xxx.x chat.localtrieve.com
192.168.xxx.x api.localtrieve.com
192.168.xxx.x dashboard.localtrieve.com
192.168.xxx.x search.localtrieve.com
127.0.0.1 trieve-keycloak-service
```


## 6. Port-forward Keycloak

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


### 7. Open trieve

Open [dashboard.localtrieve.com](http://dashboard.localtrieve.com) in your browser.

## Optional commands

Scale down all embedding servers:

```shell
kubectl scale deployment trieve-embedding-bgem3 trieve-embedding-jina trieve-embedding-reranker trieve-embedding-splade-doc trieve-embedding-splade-query --replicas 0

```
9 changes: 9 additions & 0 deletions glasskube/dependencies/clickhouse-operator.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: packages.glasskube.dev/v1alpha1
kind: ClusterPackage
metadata:
name: clickhouse-operator
spec:
packageInfo:
name: clickhouse-operator
version: v0.23.7+2
repositoryName: glasskube
9 changes: 9 additions & 0 deletions glasskube/dependencies/cloudnative-pg.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: packages.glasskube.dev/v1alpha1
kind: ClusterPackage
metadata:
name: cloudnative-pg
spec:
packageInfo:
name: cloudnative-pg
version: v1.24.0+1
repositoryName: glasskube
9 changes: 9 additions & 0 deletions glasskube/dependencies/keycloak-operator.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: packages.glasskube.dev/v1alpha1
kind: Package
metadata:
name: trieve-keycloak-operator
spec:
packageInfo:
name: keycloak-operator
version: v25.0.2+1
repositoryName: glasskube
9 changes: 9 additions & 0 deletions glasskube/dependencies/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace: default
resources:
- cloudnative-pg.yaml
- clickhouse-operator.yaml
- keycloak-operator.yaml
- qdrant.yaml
- redis.yaml
- tika.yaml

9 changes: 9 additions & 0 deletions glasskube/dependencies/qdrant.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: packages.glasskube.dev/v1alpha1
kind: Package
metadata:
name: trieve-qdrant
spec:
packageInfo:
name: qdrant
repositoryName: glasskube
version: v1.11.1+1
9 changes: 9 additions & 0 deletions glasskube/dependencies/redis.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: packages.glasskube.dev/v1alpha1
kind: Package
metadata:
name: trieve-redis
spec:
packageInfo:
name: redis
repositoryName: glasskube
version: v7.4.0+1
9 changes: 9 additions & 0 deletions glasskube/dependencies/tika.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: packages.glasskube.dev/v1alpha1
kind: Package
metadata:
name: trieve-tika
spec:
packageInfo:
name: tika
repositoryName: glasskube
version: v2.9.2+1
52 changes: 52 additions & 0 deletions glasskube/trieve/clickhouse.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
apiVersion: clickhouse.altinity.com/v1
kind: ClickHouseInstallation
metadata:
name: trieve-clickhouse
spec:
configuration:
users:
default/password: "password" # todo
# to allow access outside from kubernetes
default/networks/ip:
- 0.0.0.0/0
clusters:
- name: cluster1
templates:
podTemplate: clickhouse-pod-template
layout:
shardsCount: 1
replicasCount: 1
templates:
podTemplates:
- name: clickhouse-pod-template
spec:
containers:
- name: clickhouse
image: trieve/clickhouse:latest
digest: sha256:324f541975c43e96b5df6ede74632102d89172b703960bbf01f1842ccf48d240
volumeMounts:
- name: trieve-clickhouse-data
mountPath: /var/lib/clickhouse
- name: trieve-clickhouse-logs
mountPath: /var/log/clickhouse-server
env:
- name: EMBEDDING_SERVER_URL
value: "" # todo
- name: CLICKHOUSE_ADMIN_PASSWORD
value: "password" # todo

volumeClaimTemplates:
- name: trieve-clickhouse-data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 2Gi
- name: trieve-clickhouse-logs
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 2Gi
53 changes: 53 additions & 0 deletions glasskube/trieve/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: trieve-server-config
data:
SENTRY_URL: "https://********************************@sentry.trieve.ai/6"
ADMIN_API_KEY: "admin" #generate
BASE_SERVER_URL: "http://api.localtrieve.com"
REDIS_URL: "redis://redis:6379"
QDRANT_URL: "http://trieve-qdrant-qdrant:6334"
QUANTIZE_VECTORS: "false"
REPLICATION_FACTOR: "2"
VECTOR_SIZES: "384,512,768,1024,1536,3072"
SMTP_RELAY: "smtp.fastmail.com"
SMTP_USERNAME: "noreply@trieve.ai"
SMTP_PASSWORD: "FROM SECRET"
SMTP_EMAIL_ADDRESS: "noreply@trieve.ai"
OPENAI_API_KEY: "sk-************************************************"
LLM_API_KEY: "sk-************************************************"
SECRET_KEY: "01234012340123401234012340123401234012340123401234012340123401234012340123401234" #generate
SALT: "" # OPTIOANL
S3_ENDPOINT: ""
S3_ACCESS_KEY: ""
S3_SECRET_KEY: ""
S3_BUCKET: ""
COOKIE_SECURE: "false"
TIKA_URL: "http://tika:9998"
OPENAI_BASE_URL: "https://api.openai.com/v1"
STRIPE_SECRET: "" #load from secret
STRIPE_WEBHOOK_SECRET: "" # load from secret
ADMIN_DASHBOARD_URL: "http://localhost:5173" #load
OIDC_CLIENT_SECRET: "YllmLDTy67MbsUBrUAWvQ7z9aMq0QcKx"
OIDC_CLIENT_ID: "trieve"
OIDC_AUTH_REDIRECT_URL: "http://trieve-keycloak-service:8080/realms/trieve/protocol/openid-connect/auth"
OIDC_ISSUER_URL: "http://trieve-keycloak-service:8080/realms/trieve"
GPU_SERVER_ORIGIN: "http://localhost:7070"
SPARSE_SERVER_QUERY_ORIGIN: "http://trieve-embedding-splade-query"
SPARSE_SERVER_DOC_ORIGIN: "http://trieve-embedding-splade-doc"
EMBEDDING_SERVER_ORIGIN: "http://trieve-embedding-bgem3"
EMBEDDING_SERVER_ORIGIN_BGEM3: "http://trieve-embedding-bgem3"
EMBEDDING_SERVER_ORIGIN_JINA_CODE: "http://trieve-embedding-jina"
RERANKER_SERVER_ORIGIN: "http://trieve-embedding-reranker"
UNLIMITED: "true"
REDIS_CONNECTIONS: "2"
USE_ANALYTICS: "true"
CLICKHOUSE_URL: "http://clickhouse-trieve-clickhouse:8123"
CLICKHOUSE_DB: "default"
CLICKHOUSE_USER: "default"
CLICKHOUSE_PASSWORD: "password"
JINA_CODE_API_KEY: ""
RUST_LOG: "INFO"
BM25_ACTIVE: "true"
CREATE_QDRANT_COLLECTIONS: "true"
17 changes: 17 additions & 0 deletions glasskube/trieve/embeddings/base/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: trieve-embedding
spec:
selector: {}
template:
spec:
containers:
- name: embedding
readinessProbe:
httpGet:
path: "/"
port: 80
image: ghcr.io/huggingface/text-embeddings-inference
ports:
- containerPort: 80
5 changes: 5 additions & 0 deletions glasskube/trieve/embeddings/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
resources:
- deployment.yaml
- service.yaml


11 changes: 11 additions & 0 deletions glasskube/trieve/embeddings/base/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
kind: Service
apiVersion: v1
metadata:
name: trieve-embedding
spec:
type: ClusterIP
ports:
- port: 80
targetPort: 80
protocol: TCP
name: svc
13 changes: 13 additions & 0 deletions glasskube/trieve/embeddings/bgem3/deployment-patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: trieve-embedding
spec:
selector: {}
template:
spec:
containers:
- name: embedding
args:
- --model-id
- BAAI/bge-m3
7 changes: 7 additions & 0 deletions glasskube/trieve/embeddings/bgem3/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
commonLabels:
app.kubernetes.io/component: embedding-bgem3
nameSuffix: -bgem3
resources:
- ../base
patches:
- path: deployment-patch.yaml
4 changes: 4 additions & 0 deletions glasskube/trieve/embeddings/components/cpu/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
kind: Component
images:
- name: ghcr.io/huggingface/text-embeddings-inference
newTag: cpu-1.4
13 changes: 13 additions & 0 deletions glasskube/trieve/embeddings/components/gpu/deployment-patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: trieve-embedding
spec:
selector: {}
template:
spec:
containers:
- name: embedding
resources:
limits:
nvidia.com/gpu: "1"
6 changes: 6 additions & 0 deletions glasskube/trieve/embeddings/components/gpu/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Component
images:
- name: ghcr.io/huggingface/text-embeddings-inference
newTag: 89-1.2
patches:
- path: deployment-patch.yaml
15 changes: 15 additions & 0 deletions glasskube/trieve/embeddings/jina/deployment-patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: trieve-embedding
spec:
selector: {}
template:
spec:
containers:
- name: embedding
args:
- --model-id
- jinaai/jina-embeddings-v2-base-en
- --revision
- main
7 changes: 7 additions & 0 deletions glasskube/trieve/embeddings/jina/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
commonLabels:
app.kubernetes.io/component: embedding-jina
nameSuffix: -jina
resources:
- ../base
patches:
- path: deployment-patch.yaml
8 changes: 8 additions & 0 deletions glasskube/trieve/embeddings/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
resources:
- bgem3
- jina
- reranker
- splade-doc
- splade-query
components:
- components/cpu
15 changes: 15 additions & 0 deletions glasskube/trieve/embeddings/reranker/deployment-patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: trieve-embedding
spec:
selector: {}
template:
spec:
containers:
- name: embedding
args:
- --model-id
- BAAI/bge-reranker-base
- --revision
- main
Loading