Skip to content
TEBHOS API

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.

RequirementDetails
KubernetesVersion 1.29 or newer
HelmHelm 3 or Helm 4
ResourcesThe pods request about 1 CPU and 4.5 GB of memory, and their limits add up to about 19 GB
StorageA default StorageClass with ReadWriteOnce volumes
Web trafficAn ingress controller and cert-manager, or a Gateway API gateway
Visitor addressesThe ingress controller sees each visitor’s address, through externalTrafficPolicy: Local or the PROXY protocol
DNSAn A record for your domain that points to the ingress controller or the load balancer
VoiceTCP 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.

Get the chart and write a values file with your domain.

Terminal window
git clone --depth 1 https://github.com/RamazanAyy/tebhos.git
printf 'domain: chat.example.com\n' > tebhos-values.yaml

Install it into its own namespace.

Terminal window
helm install tebhos ./tebhos/deploy/helm/tebhos \
--namespace tebhos --create-namespace \
-f tebhos-values.yaml --wait --timeout 15m

Keep 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.

Terminal window
kubectl -n tebhos get secret tebhos-env -o jsonpath='{.data.TEBHOS_SETUP_TOKEN}' | base64 -d

If the Secret has no setup token, the API wrote one to its log when it first started.

Terminal window
kubectl -n tebhos logs deployment/api | grep -i 'setup token'

The chart’s values.yaml explains every value. These are the ones most installs change.

ValueWhat it sets
domainThe address people use for your instance
emailThe contact address for Let’s Encrypt and web push
edge.exposeingress, gateway, loadBalancer or none for a proxy of your own
livekit.exposehostNetwork (the default, needs a privileged namespace), loadBalancer or nodePort
envTEBHOS settings as NAME: value
secrets.extraSettings 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.

To use a service you already run, turn off the bundled one and say where yours is.

ServiceValues to set
Postgrespostgres.enabled: false and postgres.external.host, or a URL in secrets.extra.TEBHOS_POSTGRES_URL
Valkeyvalkey.enabled: false and valkey.external.url, or a URL with a password in secrets.extra.TEBHOS_KV_URL
NATSnats.enabled: false and nats.external.url
Meilisearchmeilisearch.enabled: false and meilisearch.external.url
S3 storageseaweedfs.enabled: false and s3.endpoint
LiveKitlivekit.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.

Pull the chart and upgrade with the same values file. A new image.revision restarts every TEBHOS pod, which pulls the newest TEBHOS images.

Terminal window
git -C tebhos pull
helm upgrade tebhos ./tebhos/deploy/helm/tebhos -n tebhos -f tebhos-values.yaml \
--set-string image.revision=$(date +%s) --wait --timeout 15m

helm rollback goes back to the previous values and images, but it doesn’t undo changes to the database.

Back up the Secrets and the database.

Terminal window
kubectl -n tebhos get secret tebhos-env tebhos-unfurl-env -o yaml \
| grep -v -E '^ (resourceVersion|uid|creationTimestamp):' > tebhos-env.yaml
kubectl -n tebhos exec postgres-0 -- sh -c 'pg_dump -U "$POSTGRES_USER" -d "$POSTGRES_DB" --format=custom' > tebhos.dump

A 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.

Terminal window
kubectl create namespace tebhos
kubectl apply -f tebhos-env.yaml
helm install tebhos ./tebhos/deploy/helm/tebhos -n tebhos -f tebhos-values.yaml --wait --timeout 15m

Stop everything except Postgres and restore the database.

Terminal window
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.dump

Restore the data-seaweedfs-0 volume from its snapshot with your storage provider. Then start everything again.

Terminal window
helm upgrade tebhos ./tebhos/deploy/helm/tebhos -n tebhos -f tebhos-values.yaml --wait --timeout 15m
Terminal window
helm uninstall tebhos -n tebhos

The 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.

Terminal window
kubectl -n tebhos delete secret tebhos-env tebhos-unfurl-env
kubectl -n tebhos delete pvc -l app.kubernetes.io/instance=tebhos
kubectl delete namespace tebhos