Skip to content

Commit

Permalink
feat: update kubernetes helm to released version
Browse files Browse the repository at this point in the history
  • Loading branch information
Steffen911 committed Dec 9, 2024
1 parent 9534be1 commit e2618c3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 44 deletions.
3 changes: 1 addition & 2 deletions next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
/// <reference types="next/navigation-types/compat/navigation" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.
// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information.
61 changes: 19 additions & 42 deletions pages/self-hosting/kubernetes-helm.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ This guide will walk you through the steps to deploy Langfuse on Kubernetes usin
You will need access to a Kubernetes cluster and Helm installed on your local machine.
For the purposes of this guide, we will use a local minikube instance, but each step should extend to a managed Kubernetes service like GKE, EKS, or AKS.

By default, the chart will deploy the Langfuse application containers and data stores ([architecture overview](/self-hosting#architecture)). You can optionally point to an existing PostgreSQL, Clickhouse and Redis instance. See [Readme](https://github.com/langfuse/langfuse-k8s/blob/lfe-1348-v3-chart/README.md) for more details.
By default, the chart will deploy the Langfuse application containers and data stores ([architecture overview](/self-hosting#architecture)).
You can optionally point to an existing PostgreSQL, Clickhouse and Redis instance.
See [Readme](https://github.com/langfuse/langfuse-k8s) for more details.

<Callout type="info">
If you are interested in contributing to our Kubernetes deployment guide or
Expand All @@ -19,76 +21,51 @@ By default, the chart will deploy the Langfuse application containers and data s
Discussion](https://github.com/orgs/langfuse/discussions/1902).
</Callout>

<Callout type="info">
This guide references the `lfe-1348-v3-chart` branch and v3-preview. It will
be updated to `v3.0.0` on Dec 9, 2024.
</Callout>

Planned: Cloud-specific deployment guides, please upvote and comment on the following threads: [AWS](https://github.com/orgs/langfuse/discussions/4645), [Google Cloud](https://github.com/orgs/langfuse/discussions/4646),[Azure](https://github.com/orgs/langfuse/discussions/4647).

## Fetch the Helm chart and customize values

Fetch the `langfuse-k8s` GitHub repository to your local machine to install using Helm.

```bash
git clone https://github.com/langfuse/langfuse-k8s.git

cd langfuse-k8s/charts/langfuse
```

Checkout the `lfe-1348-v3-chart` branch. This will be merged on Dec 9, 2024.
Fetch the `langfuse-k8s` Helm chart.

```bash
git checkout lfe-1348-v3-chart
helm repo add langfuse https://langfuse.github.io/langfuse-k8s
helm repo update
```

For local experimentation, the pre-configured variables in the values.yaml file are usually sufficient.

If you send _any_ kind of sensitive data to the application or intend to keep it up for longer, we recommend that
you modify the values.yaml file and overwrite the following environment variables using the `additionalEnv` field:

- `SALT`: A random string used to hash passwords. It should be at least 32 characters long.
- `ENCRYPTION_KEY`: Generate this via `openssl rand -base64 32`.
- `NEXTAUTH_SECRET`: A random string used to sign JWT tokens.
- `NEXTAUTH_URL`: The URL where the application is hosted. Used for redirects after signup.

In addition, you can change the database and storage credentials to be more secure.
you modify the values.yaml file according to your needs

For a comprehensive overview of all available environment variables and configuration options, please refer to the [configuration guide](/self-hosting/configuration).

## Deploy the helm chart

Create a new namespace for the Langfuse deployment, e.g.:

```bash
kubectl create namespace langfuse-v3-preview
```

Download the Helm chart dependencies:
Create a new namespace for the Langfuse deployment (optional), e.g.:

```bash
helm dependency update
kubectl create namespace langfuse
```

Install the Helm chart to our demo namespace:
Install the Helm chart into your namespace:

```bash
helm install langfuse . -n langfuse-v3-preview
helm install langfuse langfuse/langfuse -n langfuse
```

Our chart assumes that it's installed as `langfuse`.
If you want to install it with a different name, you will have to adjust the Redis hostname in the `values.yaml` accordingly.

At this point, Kubernetes will start to deploy the Langfuse application and its dependencies.
This can take up to 5 minutes.
You can monitor the progress by checking `kubectl get pods -n langfuse-v3-preview` - we expect all pods to be running eventually.
You can monitor the progress by checking `kubectl get pods -n langfuse` - we expect all pods to be running eventually.
The langfuse-web and langfuse-worker container will restart a couple of times while the databases are being provisioned.

## Smoke test UI

The Langfuse UI will be served on a NodePort service.
Use `kubectl get services -n langfuse-v3-preview` and search for `langfuse-web` to see the port mapping.
You can access the Langfuse UI by visiting `http://<minikube-ip>:<nodeport>` in your browser.
The Langfuse UI will be served on a ClusterIP service by default.
Use `kubectl get services -n langfuse` and search for `langfuse-web` to see the port mapping.
Create a port-forward via `kubectl port-forward svc/langfuse-web -n langfuse <local-port>:<nodeport>` and access the UI via `http://localhost:<local-port>` in your browser.
Go ahead and register, create a new organization, project, and explore Langfuse.

## Features
Expand All @@ -105,17 +82,17 @@ import SelfHostFeatures from "@/components-mdx/self-host-features.mdx";
You can delete the Helm release and the namespace to clean up the resources:

```bash
helm uninstall langfuse -n langfuse-v3-preview
kubectl delete namespace langfuse-v3-preview
helm uninstall langfuse -n langfuse
kubectl delete namespace langfuse
```

## How to Upgrade

Run the following commands to upgrade the Helm chart to the latest version:

```bash
helm dependency update
helm upgrade langfuse . -n langfuse-v3-preview
helm repo update
helm upgrade langfuse langfuse/langfuse -n langfuse
```

For more details on upgrading, please refer to the [upgrade guide](/self-hosting/upgrade).

0 comments on commit e2618c3

Please sign in to comment.