Run Tessl work on your own Kubernetes cluster
The Tessl controller runs on your Kubernetes cluster. It asks Tessl for work, such as an eval's solves or a launch run, and runs each piece of work, called an attempt, as one Kubernetes Job on your nodes. The controller connects out to Tessl; Tessl never connects in to your cluster.
This page is for the platform team that installs it. It covers what the cluster needs, what the Helm chart installs and with which rights, which hosts the attempts reach, what reaches Tessl, and how to run, rotate and remove the controller.
Before you start
Tessl registers the controller for your organization and gives you:
- a selector, such as
controller-acme, that names your controller when you start work on it; - a controller token, which the controller presents to Tessl. Tessl keeps only its hash;
- the chart package,
tessl-controller-<version>.tgz, and values files that name the controller, install and reference worker images by digest.
Tell Tessl at registration which model mode you want. The mode is part of the registration, and the chart must match it.
Cluster requirements
- Kubernetes 1.31 or later. The chart refuses an older cluster.
- A network plugin that enforces NetworkPolicy, such as Calico or Cilium. The chart closes the attempts' network with NetworkPolicies. On a plugin that does not enforce them, the controller's canary fails and the controller claims no work. Amazon EKS on Fargate does not enforce them; see Amazon EKS.
- Pod Security
restrictedon the runs namespace. When the chart creates the namespace it enforcesrestricted. If you create the namespace yourself, it needsbaselineor stricter, theRuntimeDefaultseccomp profile allowed, and nothing that mounts a service account token into its pods. - Linux nodes, amd64 or arm64, and glibc worker images. The reference worker image is Ubuntu. An image you build for attempts must be glibc based, not musl based such as Alpine.
- Node disk and memory for the attempts. By default each attempt requests and is limited to 2 CPUs, 4 GiB of memory and 20 GiB of ephemeral storage, and 4 attempts run at once (
capacity.maxConcurrent). Size the nodes that run attempts for that many attempts, on top of their other pods. - Image pulls. Your nodes pull the three images from Tessl's registry or from your own mirror. Image pulls go through your nodes, not through the egress proxy.
What the chart installs
The controller gets only namespaced rights. The chart installs no CRD, webhook, ClusterRole or ClusterRoleBinding. The only cluster-scoped objects it touches are the two Namespaces: by default it creates them, so the installer needs get, create and patch on those two Namespaces; with namespaces.create: false it only looks them up, and the installer needs get on each by name.
- Two namespaces:
tessl-systemfor the controller andtessl-runsfor the attempts' Jobs. Withnamespaces.create: falseit uses two namespaces you created. - The controller: one Deployment and ServiceAccount in
tessl-system, and a ConfigMap with the Job settings. It serves/healthz,/readyzand/metricson port 8080. - The egress proxy: a Deployment, Service and ServiceAccount in
tessl-system. It opens tunnels on port 443 to the hosts on its list only. It does not inspect TLS. - Two NetworkPolicies:
tessl-runs-egressintessl-runs, which lets the attempts' pods connect only to the egress proxy, with no DNS and no access to the Kubernetes API, as long as no other NetworkPolicy intessl-runsallows them more, andtessl-egress-proxy-ingressintessl-system, which lets only those pods reach the proxy. - A Role and RoleBinding in each namespace:
- In
tessl-runsthe controller may create, get, list, watch, patch and delete Jobs; get, list and watch pods; create and delete Secrets, for each attempt's run key; and create and patch Events. It cannot read a Secret, read a pod's logs, create a pod or exec into one. - In
tessl-systemit may create Leases and get and update thetessl-controllerLease, create and patch Events, and get the egress proxy's Service.
- In
- The
tessl-workerServiceAccount the attempts' pods run as. Nothing binds it, and its token is never mounted. - A ResourceQuota on
tessl-runsofcapacity.maxConcurrent+ 1 pods: the attempts and the controller's canary.
Keep nothing else in tessl-runs. The controller's Secret rights cover every Secret there, and a pod without the controller's label is not confined by its NetworkPolicy. Keep tessl-runs free of other NetworkPolicies that allow egress too, which matters most when you create the namespace yourself. NetworkPolicies add up: one that allows DNS or an internal subnet opens that egress beside the proxy, and the controller's canary, which tries only a public address and the Kubernetes API, does not catch it.
Hosts that leave the cluster
The controller connects to the Tessl API only. It uses the cluster's HTTPS_PROXY and NO_PROXY when they are set on its pod.
The attempts connect only through the egress proxy, which opens tunnels on port 443 to these hosts:
The chart's examples/values-us.yaml and examples/values-eu.yaml set the API and instance hosts. Add hosts your attempts need, such as a package registry, to egress.allowedHosts. No model provider is on the list: attempts reach models through Tessl's gateway or through yours.
The egress proxy itself needs DNS and outbound port 443 to these hosts, from tessl-system. To send its tunnels through your own proxy, set egress.upstreamProxy. To see which hosts the attempts ask for before you enforce the list, set egress.mode: observe: the proxy then opens a tunnel to any public host and logs each one it would refuse.
Models and what reaches Tessl
The controller runs in one of two model modes, set at registration and in the chart's modelGateway.mode:
- Tessl mode (
modelGateway.mode: tessl, the default): Tessl mints each attempt a short-lived key on its model gateway, and the agents' model requests go to it. - Customer mode (
modelGateway.mode: customer): the agents' model requests go only to your gateway, such as a LiteLLM you run. Tessl mints no model key, and neither the registration nor the attempts' job settings carry your gateway's address or key to Tessl. Error records can name the address, as described below. Your gateway must list each model the attempts use, under the names Tessl's registration maps them to.
In both modes, this reaches Tessl:
- Control calls from the controller: claim, heartbeat, finish, release and adopt calls, and the list of attempts it holds. They carry the controller's instance id (its pod's name), the attempt's Job namespace, name and uid, and, when an attempt ends, its exit status and failure type and message.
- Calls from each attempt's worker: fetching the attempt's job with the attempt's run key, and a fresh upload URL when one has expired.
- Uploaded outputs: the worker uploads, through presigned URLs, to Tessl's bucket: the work's declared outputs, such as the code an eval's solve wrote and its score; the run metadata, which holds the agent's transcript, uploaded only after the runner redacts credentials from it; and the run's system log. Run metadata is also uploaded every 90 seconds while the attempt runs, so the run shows progress.
- Timeline events for launch runs: for a launch run, after the system log is uploaded, the worker tells Tessl its line count and storage key, and Tessl shows the run's timeline from it. Other attempts make no timeline call.
In Tessl mode, every model request also reaches Tessl's gateway: the prompts, and the code and files the agents send to the model.
In customer mode, model requests reach Tessl only as the transcript in the run metadata. When a request to your gateway fails, the runner's error record, which is uploaded, can name your gateway's address.
The controller's and workers' logs stay in your cluster. Tessl does not read pod logs.
To use customer mode, set the gateway in your values, and create a Secret with your gateway's key in the runs namespace. The chart creates tessl-runs when you install it, so create the Secret after helm install and before the controller's token Secret (steps 3 and 4 of Install); if you created the namespaces yourself, create it at any time before then:
The gateway URL must be https on port 443, with a fully qualified host name. Its certificate must be one the agents trust by default. Switch the mode, or change the gateway, only while no attempt is running: a running attempt keeps the gateway it started with, and the egress proxy stops letting it reach that gateway at once.
Install
-
Verify the images with cosign, as the chart's
README.mddescribes under "Verify the images". -
Write your values file,
my-values.yaml:Pass the region's example values and Tessl's image values files before your own.
-
Install the release in a namespace the chart does not create, such as
default: -
Create the controller token's Secret in
tessl-system. The chart never holds the token. The controller starts once the Secret exists: -
Wait for the controller to become ready:
The controller is ready once its canary has passed: a Job in
tessl-runsthat checks that a direct connection out fails and a tunnel to the Tessl API through the egress proxy opens. Until then it claims no work, andkubectl get events -n tessl-systemand the controller's log say why. -
Check that Tessl accepts the token. Readiness does not cover it: a controller whose token Tessl refuses is still ready, and claims no work. This lists nothing while Tessl accepts the token:
An event that ends in
status 401means Tessl refused the token.
Run an eval on your cluster
Pass your controller's selector to tessl eval run:
The eval's solves run as Jobs in tessl-runs. Watch them with:
Without --controller, the eval runs on Tessl's sandboxes.
Build your own worker image
The reference worker image, run.image, carries the tools and agent CLIs an attempt uses: git, gh, tessl, Claude Code and Codex among them. To add your own tools, build an image FROM the reference image by its digest:
Keep these, or the attempts fail:
tessl-runnerat/usr/local/bin/tessl-runner, or setrun.runnerPathto where your image has it;- uid 1001 able to write
/workspace, or changeworker.runAsUserandrun.workVolumePathto match; - a glibc Linux base, for each architecture your nodes run.
Push it to your registry, then set run.image to it by digest and upgrade the release:
run.image is versioned on its own: it needs no matching controller version.
Rotate the controller token
A registration can hold more than one token at once, so you can rotate without downtime:
-
Ask Tessl for a new token on your registration. The old one keeps working.
-
Replace the Secret's token with the new one:
-
Restart the controller, which reads the token only when it starts, and wait for it:
A restart does not stop the attempts that are running. The new controller adopts them.
-
Check that Tessl accepts the new token: no new
TesslUnreachableevent from the new controller pod, as in the last install step. -
Ask Tessl to revoke the old token.
If a token has leaked while attempts are running, ask Tessl to revoke the whole registration: that also cancels its running attempts and revokes their run keys.
Uninstall
Stopping the controller releases the attempts it holds without reporting how they end, so Tessl fails them. The chart has no way to drain. Check how many attempts it holds first, in tessl_controller_held_attempts on the controller's /metrics, and remove the controller while it is zero or you accept those failures.
helm uninstall deletes the chart's own objects, the egress proxy and both NetworkPolicies among them. It does not delete the attempts' Jobs, which the controller created, so an attempt's pod still running after it would have no network confinement. Stop the controller and delete the Jobs first, while the NetworkPolicies still confine their pods:
kubectl scale only lowers the replica count. kubectl wait returns once the controller's pod has exited, so from then on nothing creates an attempt or canary Job. --cascade=foreground makes each delete return only once the Job's pods are gone, and the last two commands list nothing once no attempt or canary Job or pod is left. Then uninstall the release:
Helm keeps both namespaces, and what it did not create in them: the token's Secret and the tessl-controller Lease. Delete the namespaces once nothing in them is needed:
Or, to keep the namespaces, delete what is left:
Then ask Tessl to revoke the registration.
Azure Kubernetes Service (AKS)
- Network policy engine. AKS enforces NetworkPolicy only with a network policy engine. Create the cluster with Azure CNI powered by Cilium (
--network-dataplane cilium), or with Calico (--network-policy calico). A cluster with no network policy engine fails the controller's canary. - Azure Container Registry. You can mirror the three images to Azure Container Registry and pull them from there. Copy them with a tool that copies OCI referrers too, such as
oras cp -r, so the signatures and SBOMs come along and cosign can verify the copies. Then setcontroller.image,worker.imageandrun.imageto the mirror by the same digests. A cluster attached to the registry withaz aks update --attach-acrneeds noimagePullSecrets.
Amazon Elastic Kubernetes Service (EKS)
- No attempts on Fargate. EKS does not apply NetworkPolicies to Fargate pods (Amazon EKS network policy considerations). A NetworkPolicy is accepted and has no effect, so on a cluster that runs
tessl-runson Fargate the chart installs, the controller's canary fails, and the controller stays not Ready and claims no work. - Run attempts on EC2 nodes, such as a managed node group, with a network plugin that enforces NetworkPolicy: the Amazon VPC CNI add-on with network policy turned on (
"enableNetworkPolicy": "true"in the add-on's configuration values, VPC CNI 1.14 or later, nodes on Linux kernel 5.10 or later; see Restrict Pod network traffic with Kubernetes network policies), or Calico or Cilium. In its default standard mode the VPC CNI lets a new pod's traffic through until its policies are in place. SettingNETWORK_POLICY_ENFORCING_MODEtostrictin theaws-nodeDaemonSet starts new pods with traffic denied instead, for every pod on the cluster, so each one then needs a NetworkPolicy for everything it reaches. - The controller may run on Fargate. The egress proxy may not. No NetworkPolicy selects the controller's pod, so it needs no enforcement.
tessl-egress-proxy-ingressselects the egress proxy's pod intessl-systemand lets only the attempts reach it, so the proxy needs an enforcing node too. The canary does not catch a proxy on Fargate: it tests the attempts' egress, not who else can reach the proxy. To put only the controller on Fargate, give the Fargate profile fortessl-systemthe label selectorapp.kubernetes.io/component: controller.