AWS Self Hosting
Learn how to self-host Trieve on AWS
AWS EKS
Things you need
- Domain name
- An allowance for at least 8vCPU for G and VT instances
- helm cli
- aws cli
- kubectl
- k9s (optional)
Provision Terraform
aws should be configured with your IAM credentails chosen. Run the following commands to create the EKS cluster
This should provision an eks cluster with elb and ebs drivers
2.5 Setup embedding servers
Due to many issues with the NVIDIA k8s-device-plugin, we have not figured out how to do fractional GPU usage for pods within kubernetes, meaning its not economically reasonable to have the GPU embedding server within Kubernetes. For this reason we have a docker-compose.yml
that is recommended to be ran on the ec2 box provisioned within the Terraform. (Note it uses ~/.ssh/id_ed25519
as a default key). The user to login as is dev
.
3 Create values.yaml
This step generates a file in helm/values.yaml
. It alllows you to modify the environment variables
Additionally, you will need to modify values.yaml in two ways,
First you will need to change all the embedding server origins to point to the embedding server url as follows.
Since the embbedding servers are not included in the kubernetes cluster, remove all items in the embeddings list below and leave it empty as follows
SubChart usage
Postgres, Redis, and qdrant are installed within this helm chart via a subchart. You can opt out of using the helm chart installation and using a managed service can be toggled via. the useSubChart
parameters and setting the uri
to a managed service. We reccomend placing at least Postgres and Redis out side of the helm chart and keeping Qdrant in the helm chart for a production usecase.
4. Deploy the helm chart
Ensure everything has been deployed with
6. Set DNS records
First get the ingress addresses using
You will get output that looks like this
Set CNAME’s accordingly, we recommend using Cloudflare to CNAME and provision the SSL Cert
Once you set the ingress rules properly, the server should be able to properly deploy.
7. Setup/OIDC provider and Authorized Redirect URL’S
The last step is to setup an OIDC compliant server like keycloak
for authentication and get an issuerUrl
and clientSecret
. This is how you do it within Keycloak.
A) Create a new realm called trieve
B) Go into Clients and create a new client called trieve
.
Enable client authentication and set the following allowed redirect url’s
- https://api.domain.com/*
- https://search.domain.com/*
- https://chat.domain.com/*
- https://dashboard.domain.com/*
You will get the client secret in the Credentials
tab.
You will need to set the following values in the helm/values.yaml
file, it should be prefilled already with default values
Testing
The fastest way to test is using the Trieve CLI
And there you have it. Your very own Trieve stack. Happy hacking 🚀