tembo Helm chart installs the platform in one namespace. Agent sessions don’t run in the cluster: they run in virtual machines on agent hosts, cloud instances that the chart’s host controller launches, scales and replaces.
Services in the cluster
The chart generates the secrets the platform needs once, such as signing and encryption keys and the GitHub webhook secret, and keeps them across upgrades.
Tembo keeps project images, session snapshots, file uploads and agent assets in one object storage bucket (S3 or GCS), which the Terraform module creates.
Your Helm values describe the whole install. The chart passes the same configuration to agent hosts through a Kubernetes Secret, which each host reads when it starts. Model providers, workspaces and members are set up in the Tembo app.
Agent hosts
Agent hosts are EC2 instances on AWS, or Compute Engine instances on GCP, started from Tembo’s agent host image. They need nested virtualization, and keep VM disks, snapshots and saved memory on the instance’s local NVMe. They connect directly to Postgres, Redis and Sandbar. You describe them in your Helm values with two resources. The Terraform module’s Helm values create one of each, nameddefault:
- A host class says what to launch: the image, instance types, subnets, security groups, instance profile and root volume.
- A pool says how many to run:
minHosts,maxHosts, andminIdleMemory, the free memory to keep for new sessions.
Lifecycle
- Launch. The controller starts an instance with the class’s settings and tags it as its own. It only manages instances it created.
- Configure. The host reads its configuration from a Kubernetes Secret through the cluster’s API, with a short-lived token the controller gives it at launch.
- Register. The host registers with your install and becomes
Ready, usually within a few minutes. The controller replaces a host that doesn’t register within 15 minutes. - Run sessions. The host claims sessions and runs each one in its own virtual machine.
Scaling
The controller sizes each pool by memory: the memory its sessions use, plus the memory waiting sessions need, plusminIdleMemory. When that’s more than the pool’s hosts provide, it launches another host, up to maxHosts. It never goes below minHosts.
When a pool has more hosts than it needs, the controller removes a host that has been idle for disruption.idleAfter (10 minutes by default): no session virtual machines, agent turns or host jobs. Warm VMs don’t count. It removes the newest idle host, one per pool at a time.
To scale to zero, set both minHosts: 0 and minIdleMemory: 0 (see Agent hosts).
Scheduled minimum hosts
To keep hosts running during busy periods, such as working hours, add schedules to a pool. Each one raises the pool’s minimum for a period that starts on a cron schedule, so the first sessions of the day don’t wait for a host to start. Outside its periods, the pool scales as usual. Chart 1.6.0 and later.- The pool keeps the highest of
minHostsand each active schedule’sminHosts, up tomaxHosts. Schedules never lowerminHostsor changemaxHosts. - Hosts launch when a period starts. When it ends, the extra hosts are removed once idle, like any others.
scheduleuses standard five-field cron syntax. A pool can have up to 20 schedules.- A schedule that doesn’t parse, or names an unknown time zone, sets the pool’s
Readycondition toFalsewith reasonInvalidMinHostsSchedule. The pool keeps using its other schedules.
Replacing hosts
Hosts read their image and configuration only when they start. Within about five minutes of a change that reaches them, such as the GitHub App, your hostname, the database or a new agent host image, the controller marks running hostsDrifted and replaces them, as many at a time as the pool’s disruption budget allows (one by default):
- The pool launches a replacement while the old host keeps taking sessions. If
maxHostsleaves no room, the old host is cordoned right away and replaced once it’s gone. - Once the replacement is ready, the old host is cordoned: it keeps serving its sessions, but new sessions go to other hosts.
- Once the old host has been idle for the pool’s idle period, the controller drains and terminates it.
drainTimeout (105 minutes by default) is marked DrainStalled. If a session starts on a draining host, the controller keeps the host.
Managing hosts by hand
Sessions on a host
- Stopping. When a session goes idle, its virtual machine stops. The host saves a snapshot of its disk and memory, and uploads the disk to object storage.
- Resuming. On the same host, a session resumes from saved memory, with its processes still running. On another host, for example after its host was replaced, it resumes from the disk in object storage, without the processes that were running.
- Project images. A project build stores an image of the project’s environment in object storage. Hosts download it on first use and keep a copy, so later sessions start in seconds.
- Warm VMs. For projects with Warm pool on, hosts keep virtual machines booted from the project’s image, ready for the next session.