Run Buildkite Jobs on Namespace
Namespace provides ephemeral, self-hosted Buildkite agents without requiring you to operate agent infrastructure.
How it works
Connecting a Buildkite organization creates a Namespace Cluster with a default queue and an agent token. A Buildkite webhook notifies Namespace when a job is scheduled on that cluster. Namespace then provisions an isolated instance, starts an agent for the queue, runs the job, and tears the instance down when the job completes.
You can select the operating system, architecture, instance shape, base image, and persistent cache for each step using agent tags.
Getting Started
Create a Buildkite API access token
Create an API access token for the Buildkite organization you want to connect. Namespace uses this token for initial setup, ongoing build reconciliation, and build annotations, so its expiry must be set to Never. The token can be revoked at any time through the Buildkite UI. Enable these REST API scopes:
read_pipelinesread_buildsandwrite_buildsread_clustersandwrite_clustersread_organizations
Connect your Buildkite organization
Open Buildkite → Jobs in the Namespace dashboard, then enter the API token and your Buildkite organization slug, and then click Associate. Copy the generated webhook URL for the next step.
Namespace creates the Namespace Cluster, its default queue, and an agent token in your Buildkite organization.
Configure the Buildkite webhook
On the next page, click on Create new Webhook and copy and paste the provided webhook URL and token.

Select the following events in the Buildkite webhook interface:
pingjob.scheduledjob.startedjob.finished

Make sure the webhook is enabled for All Pipelines.

Add a pipeline to the Namespace Cluster
In your Buildkite pipeline's settings, select Namespace Cluster under General > Cluster to ensure that jobs for that pipeline are eligible to run on Namespace agents.
Add and remove queues
When you connect a Buildkite organization, Namespace creates a Namespace Cluster and registers its default queue to run on Namespace-managed agents.
To add an additional Namespace-managed queue:
- In Buildkite, navigate to Agents and select the cluster for which you want to create a queue.
- Create a new self hosted queue.

- Open Buildkite → Queues in the Namespace dashboard.
- Find the queue under its Buildkite cluster and click Register.
Selecting a queue
Set the queue agent tag on a pipeline or step to send jobs to the registered queue:
agents:
queue: "my-queue"Removing queues
To remove a queue, navigate to Buildkite → Queues and click Unregister next to the queue. A queue cannot be removed while it has scheduled or running jobs in Namespace.
Unregistering a queue stops Namespace from provisioning agents for it and revokes the agent token created during registration. It does not delete the queue or its cluster from Buildkite.
Checking out code
Cloning repositories over HTTPS works by default and requires no additional configuration.
To clone over SSH, follow Buildkite's code access setup for self-hosted agents. Store your private key as a Buildkite secret, then set checkout.ssh_secret on each of your pipeline's steps that require SSH access:
steps:
- label: "Build"
command: "make build"
checkout:
ssh_secret: "MY_SSH_KEY"Next Steps
Configure Buildkite Agents. Choose compute resources, base images, and persistent caches with agent tags.