Kubernetes
The Helm chart in deploy/helm/tebhos runs the same TEBHOS services that rexctl runs on one machine. You install and upgrade it with Helm, because rexctl doesn’t manage a Kubernetes install.
What you need
Section titled “What you need”| Requirement | Details |
|---|---|
| Kubernetes | Version 1.29 or newer |
| Helm | Helm 3 or Helm 4 |
| Resources | The pods request about 1 CPU and 4.5 GB of memory, and their limits add up to about 19 GB |
| Storage | A default StorageClass with ReadWriteOnce volumes |
| Web traffic | An ingress controller and cert-manager, or a Gateway API gateway |
| Visitor addresses | The ingress controller sees each visitor’s address, through externalTrafficPolicy: Local or the PROXY protocol |
| DNS | An A record for your domain that points to the ingress controller or the load balancer |
| Voice | TCP port 7881 and UDP port 7882 open to LiveKit |
With edge.expose: loadBalancer you need neither an ingress controller nor cert-manager, and TEBHOS gets its own certificate.
If the ingress controller doesn’t see each visitor’s address, every visitor shares one address and hits the same sign-in limits.
The install stops with a message when the cluster is missing something it needs.
Install
Section titled “Install”Get the chart and write a values file with your domain.
git clone --depth 1 https://github.com/RamazanAyy/tebhos.gitprintf 'domain: chat.example.com\n' > tebhos-values.yamlInstall it into its own namespace.
helm install tebhos ./tebhos/deploy/helm/tebhos \ --namespace tebhos --create-namespace \ -f tebhos-values.yaml --wait --timeout 15mKeep tebhos-values.yaml for upgrades. When the install is done, helm test tebhos -n tebhos checks that the instance answers for your domain.
Open your domain in a browser to create your admin account. The setup page asks for the setup token in the tebhos-env Secret.
kubectl -n tebhos get secret tebhos-env -o jsonpath='{.data.TEBHOS_SETUP_TOKEN}' | base64 -dIf the Secret has no setup token, the API wrote one to its log when it first started.
kubectl -n tebhos logs deployment/api | grep -i 'setup token'Values
Section titled “Values”The chart’s values.yaml explains every value. These are the ones most installs change.
| Value | What it sets |
|---|---|
domain | The address people use for your instance |
email | The contact address for Let’s Encrypt and web push |
edge.expose | ingress, gateway, loadBalancer or none for a proxy of your own |
livekit.expose | hostNetwork (the default, needs a privileged namespace), loadBalancer or nodePort |
env | TEBHOS settings as NAME: value |
secrets.extra | Settings that have a password or a key |
Under Argo CD or helm template, set secrets.generate: false and give every key in secrets.values, or put a Secret you manage in secrets.existingSecret.
External services
Section titled “External services”To use a service you already run, turn off the bundled one and say where yours is.
| Service | Values to set |
|---|---|
| Postgres | postgres.enabled: false and postgres.external.host, or a URL in secrets.extra.TEBHOS_POSTGRES_URL |
| Valkey | valkey.enabled: false and valkey.external.url, or a URL with a password in secrets.extra.TEBHOS_KV_URL |
| NATS | nats.enabled: false and nats.external.url |
| Meilisearch | meilisearch.enabled: false and meilisearch.external.url |
| S3 storage | seaweedfs.enabled: false and s3.endpoint |
| LiveKit | livekit.enabled: false, livekit.external.url and livekit.external.publicUrl |
The Postgres database and role, and the S3 buckets in s3.buckets, must exist before you install. Put passwords and keys in secrets.values under the key values.yaml gives for each service.
Point your LiveKit server’s webhook at https://<your domain>/api/webhooks/livekit, signed with the key in TEBHOS_LIVEKIT_API_KEY.
Upgrade
Section titled “Upgrade”Pull the chart and upgrade with the same values file. A new image.revision restarts every TEBHOS pod, which pulls the newest TEBHOS images.
git -C tebhos pullhelm upgrade tebhos ./tebhos/deploy/helm/tebhos -n tebhos -f tebhos-values.yaml \ --set-string image.revision=$(date +%s) --wait --timeout 15mhelm rollback goes back to the previous values and images, but it doesn’t undo changes to the database.
Back up and restore
Section titled “Back up and restore”Back up the Secrets and the database.
kubectl -n tebhos get secret tebhos-env tebhos-unfurl-env -o yaml \ | grep -v -E '^ (resourceVersion|uid|creationTimestamp):' > tebhos-env.yamlkubectl -n tebhos exec postgres-0 -- sh -c 'pg_dump -U "$POSTGRES_USER" -d "$POSTGRES_DB" --format=custom' > tebhos.dumpA restored database only works with the same Secrets. Keep tebhos-env.yaml as safe as the dump.
Uploads are on the volume data-seaweedfs-0. Back it up with a snapshot from your storage provider.
To restore, put the Secrets back before you install, and the new release uses the same secrets.
kubectl create namespace tebhoskubectl apply -f tebhos-env.yamlhelm install tebhos ./tebhos/deploy/helm/tebhos -n tebhos -f tebhos-values.yaml --wait --timeout 15mStop everything except Postgres and restore the database.
kubectl -n tebhos scale deployment,statefulset --replicas=0 \ -l 'app.kubernetes.io/part-of=tebhos,app.kubernetes.io/name notin (postgres)'kubectl -n tebhos exec -i postgres-0 -- sh -c 'pg_restore -U "$POSTGRES_USER" -d "$POSTGRES_DB" --clean --if-exists' < tebhos.dumpRestore the data-seaweedfs-0 volume from its snapshot with your storage provider. Then start everything again.
helm upgrade tebhos ./tebhos/deploy/helm/tebhos -n tebhos -f tebhos-values.yaml --wait --timeout 15mUninstall
Section titled “Uninstall”helm uninstall tebhos -n tebhosThe Secrets and the volumes stay, and a new install with the same release name and namespace uses them again. To delete everything, delete them too.
kubectl -n tebhos delete secret tebhos-env tebhos-unfurl-envkubectl -n tebhos delete pvc -l app.kubernetes.io/instance=tebhoskubectl delete namespace tebhos