Skip to main content
Bring your own cloud (BYOC) lets your team run Tensorlake sandboxes on compute that you own. Your code, sandbox storage, and executor capacity stay in your AWS account. Your data never leaves your AWS account, and Tensorlake has no access to data in your AWS account. Tensorlake Cloud remains the control plane that schedules work and gives your team one API for managing sandboxes. Sandboxes always run on executors in your account.

Overview

BYOC on AWS has two deployment modes. Both run sandboxes on executors in your own AWS account and keep your project bucket in your account. They differ in who runs the Sandbox Proxy, the component that terminates sandbox traffic and forwards it to an executor.

Compute in your network

Users reach a Sandbox Proxy that Tensorlake runs behind a load balancer in a Tensorlake AWS account. The proxy reaches executors in your AWS account across a VPC peering connection on private ports 5565 and 8095 to 8097. Executors write runtime data and snapshots to your Amazon S3 bucket, and both the proxy and the executors open outbound HTTPS connections to Tensorlake Cloud.

Compute and ingress in your network

Users reach an AWS Network Load Balancer in your AWS account. The load balancer sends traffic to the Sandbox Proxy on Amazon EKS, which reaches executors on bare-metal Amazon EC2 over the private VPC. Executors write runtime data and snapshots to Amazon S3. The Sandbox Proxy and the executors both open outbound HTTPS connections to Tensorlake Cloud.

Choose a deployment mode

Before you begin

Tensorlake requirements

You need a Tensorlake project with Self-hosted Compute enabled. You also need permission to change the project settings and create a project-admin API key. If the Self-hosted Compute page is not available, contact Tensorlake. The same project-admin API key can prepare the Sandbox Proxy and enroll the first executor. Treat the key as a secret. Do not save it in an EC2 user-data script.

AWS account requirements

Prepare these resources in the AWS Region where you want to run sandboxes. Both modes need:
  • A VPC.
  • An S3 bucket for runtime data, built images, and durable sandbox snapshots.
  • An EC2 instance profile that can use the project bucket.
  • Capacity for at least one supported bare-metal EC2 instance: i7i.metal-24xl or i7i.metal-48xl.
Compute and ingress in your network also needs:
  • An EKS cluster.
  • The AWS Load Balancer Controller, version 2.7.2 or later.
  • An IAM role that gives the controller permission to create an AWS Network Load Balancer (NLB), target groups, and security-group rules.
  • A public DNS zone for the sandbox domain.
  • An AWS Certificate Manager (ACM) certificate for the sandbox domain.

Sandbox base domain

If you run the ingress, choose the base domain before you create certificates or manifests. Every sandbox receives a subdomain below this base domain. For example, a base domain of sandboxes.customer.example produces URLs such as https://<sandbox-id>.sandboxes.customer.example. The public endpoint must be an HTTPS origin. Do not add a port or path. Tensorlake provides the domain in the compute-only mode.

1. Prepare project storage

Use a dedicated bucket for the project. It is the durable home for sandbox state, and executors write built sandbox images and snapshots into it. Keeping the bucket in the executor Region reduces latency and AWS data transfer costs. Block public access to the bucket. Enable encryption. If you use an AWS Key Management Service (AWS KMS) customer-managed key, give the executor instance role permission to use that key. The executor instance role needs these S3 permissions for the bucket: The enrollment preflight writes, reads, and deletes a small object under each derived storage path. This test stops the installation before a sandbox starts if the instance role cannot use the storage. Attach the role through an EC2 instance profile. Do not put static AWS access keys on the host. The Sandbox Proxy does not need this role or any other S3 permission. Open the project settings in Tensorlake Cloud. Find Node configuration and set the bucket URI:
Save the node configuration before you enroll an executor. Tensorlake derives the runtime object, image-build, and snapshot paths from the bucket URI.

2. Prepare your network

Subnet layout

If using VPC CIDR 10.90.0.0/16, you can set up this subnet layout, one subnet per Availability Zone: If you peer with Tensorlake, use the 10.90.0.0/16 range. Tensorlake standardizes on it so that every peered deployment shares one network layout. Give each executor subnet its own route table, because you add return routes to them later. If you run the ingress, tag all three public subnets with kubernetes.io/role/elb=1 so the AWS Load Balancer Controller can select them without relying on route-table discovery. See the Amazon EKS NLB requirements.

Outbound access

Allow outbound TCP 443 from the executor hosts, and from the EKS nodes if you run the ingress, to Tensorlake services and required AWS services. The EKS nodes must pull the public Sandbox Proxy image from public.ecr.aws. The executor must reach EC2 instance metadata through IMDSv2 and must reach the configured S3 bucket. Never expose executor ports to the internet in either mode. mTLS means mutual Transport Layer Security: both endpoints use certificates to verify each other.

3. Connect your deployment mode

Complete the section for the mode you chose. Do not combine them.

Connect compute in your network

Send your account details

Give Tensorlake these values through your support channel: The executor subnet ranges are the destinations Tensorlake routes to. List the exact subnets, not the whole VPC range.

Receive the onboarding packet

Tensorlake creates the peering connection from its side and sends you a packet with these fields: Verify the account, VPC, ranges, and ports before you accept anything.

Accept the peering connection

Confirm the status:
The status must be active.

Route return traffic

Add a route in all three executor subnet route tables for each provider_node_cidrs value, with the peering connection as the target. Traffic that arrives from the proxy has no return path until you do.

Allow the proxy into the executor security group

Allow each provider_node_cidrs value into every executor security group on TCP 5565 and TCP 8095-8097. Allow the /27 node ranges only. Do not allow a pod range, and do not allow the whole Tensorlake VPC range. If restrictive network ACLs protect the executor subnets, allow both request and return traffic there as well.

Connect compute and ingress in your network

Create the load balancer security group

The public NLB terminates TLS and sends traffic to the Sandbox Proxy pods. The generated Service asks the AWS Load Balancer Controller to manage the matching backend security-group rules. The controller IAM role must include permission to add and remove those rules.

Allow the proxy into the executor security group

Allow traffic from the Sandbox Proxy pod network or security group to the executor security group:

Create the public certificate

Request an ACM certificate in the same AWS account and Region as the NLB. Add both names to the certificate:
Create the DNS validation records. Wait until ACM shows the certificate status as ISSUED.

Prepare the Sandbox Proxy

The preparation script creates the customer-specific mTLS certificate, two SSH key pairs, and a local Kustomize overlay. Kustomize is a Kubernetes manifest customization tool. The script creates files only in the output directory. It does not change your cluster or AWS account. Download and run the script:
Keep the output directory secure. It contains private mTLS and SSH keys. Do not commit it to a source repository.

Set the SSH proxy public key

In the project settings in Tensorlake Cloud, set SSH proxy public key to the content of this generated file:
The Sandbox Proxy uses the matching private key when it connects to a sandbox SSH server. Leave this setting empty only if you want to disable SSH for the project. Tensorlake owns this key in the compute-only mode, so it is set only when you run the ingress yourself.

Deploy the Sandbox Proxy

Confirm the active Kubernetes context:
Review the generated manifests and run a server-side dry run:
Add a Deployment patch if the cluster requires a node selector or toleration. Then apply the resources:
Wait for the controller to publish the NLB hostname:
Confirm that both NLB target groups are healthy. The listener on port 443 uses pod port 9080. The listener on port 22 uses pod port 2222.

Create DNS records and activate the endpoint

Create two public DNS alias or CNAME records. Point both records to the NLB hostname:
You can use Amazon Route 53 or another public DNS provider. Open the project settings in Tensorlake Cloud. Set Sandbox ingress endpoint to this value:
Save the setting. Verify the public health route:
Verify that the certificate also covers sandbox subdomains:
The command prints Hostname test.sandboxes.customer.example does match certificate.

4. Launch the first executor

Launch a bare-metal EC2 instance with Ubuntu 24.04. Attach the instance profile from the storage step. The host must expose /dev/kvm because Tensorlake uses hardware virtualization to isolate sandboxes. The instance must also have local NVMe instance storage. Enrollment formats those disks and mounts them at /mnt/data, which holds container images, sandbox images, and the local snapshot cache. Amazon EBS volumes are never used for this, so an instance type without local NVMe cannot run sandboxes. These instance types meet both requirements:
Place the instance in an executor subnet that can receive Sandbox Proxy traffic. Enable IMDSv2. Give the root volume 50 GB so it holds the operating system and the downloaded components.

5. Enroll the executor

In Tensorlake Cloud, open Self-hosted Compute, select Add node, and copy the bootstrap command. It has this form:
Run the command on the EC2 instance. The bootstrap process checks the host and S3 access. It then creates the executor identity, installs the provisioner, and starts the executor services. The project-admin API key is used only during enrollment. The installed provisioner uses its own mTLS identity after enrollment. It continues to check Tensorlake for approved configuration and software updates. Return to Self-hosted Compute. Confirm that the new node appears and becomes ready before you create a sandbox.

6. Verify the complete path

Install the Tensorlake CLI if the tl command is not available:
Sign in and select the BYOC project:
Create a sandbox. Use its ID in the remaining commands:
Every sandbox gets a subdomain of the project endpoint. If you run the ingress, that is your own base domain:
Test native SSH if port 22 is enabled:
Create a snapshot and confirm that the executor writes data into the bucket:

Add more executors

Each executor needs its own EC2 instance and enrollment identity. Launch another supported host with the same network and instance-profile configuration. Then run a new command from Self-hosted Compute → Add node. The project storage and Sandbox Proxy settings apply to all executors in the project. You do not need another proxy deployment or peering connection for each host.

Updates and key rotation

The provisioner runs as a service on every enrolled executor. It checks Tensorlake for new approved profiles and applies complete updates. A failed update keeps the last valid revision active. If you run the ingress, rotate the Sandbox Proxy mTLS and SSH keys by running prepare.sh again with a new output directory. Review and apply the new resources. The certificate fingerprint starts a rolling pod update. Then replace SSH proxy public key with the new outbound.key.pub value. Keep the previous output directory in secure storage until the rollout and end-to-end test pass.

Troubleshooting

Both modes: Compute in your network: Compute and ingress in your network: