Skip to main content
Kubernetes access is in closed beta and is enabled per cluster. To request it for your team’s dedicated cluster, choose Request a cluster on the Dedicated Clusters page or contact us. Features and limits can change during the beta.
A Kubernetes reservation sets aside some of your dedicated cluster’s nodes for your team. Each member you add gets their own namespace on those nodes, and connects with kubectl through an API proxy on your team’s Tailscale tailnet.
  • Your workloads run only on the reserved nodes. Pods in a member’s namespace are always scheduled onto the reservation’s nodes, and nothing else on the cluster is scheduled there.
  • Each member works in their own namespace. Members can’t see or change other namespaces or anything cluster-wide.
  • Access goes through your tailnet. The cluster’s API server is reachable only through the reservation’s proxy, which joins your tailnet. Credentials are short-lived tokens issued with your Prime API key, so there are no long-lived kubeconfig secrets to hand around.

Before you start

Team admins set up the following once:
  • Kubernetes reservations enabled on the cluster. The Kubernetes reservation option appears in the Deploy menu only when one of your clusters supports it. During the closed beta it’s enabled on request, as described at the top of this page.
  • A Tailscale credential saved with your team. See Set up Tailscale below.
  • Team admin role. Only team admins can reserve, scale, release and manage members. Any team member can be added to a reservation.

Set up Tailscale

The reservation’s API proxy joins your tailnet as a device, using a single-use key Prime mints from your team’s Tailscale OAuth client. When the reservation is released, Prime removes the device from your tailnet.

1. Create an OAuth client in Tailscale

In the Tailscale admin console, create an OAuth client with these scopes. Both need write access: Give the client a tag, such as tag:prime-k8s. The tag must be listed in tagOwners in your tailnet policy file.

2. Allow access to the tag

The proxy serves the Kubernetes API on port 443. Add a rule to your tailnet policy file that lets your users reach it:
Replace group:ml-team with the users or groups who should be able to reach your reservations.

3. Save the credential with your team

In Team Settings → Preferences → Tailscale credentials:
  1. Click Add credential
  2. Enter a name, the client ID and client secret, and the client’s tags
  3. Click Test and save
Add Tailscale credential dialog with empty Name, Client ID and Client secret fields, the default tag tag:prime-cluster, and the Test and save button

Adding a credential. The client secret is write-only.

Prime checks the credential before saving it, and the secret is encrypted and never shown again. The same credential can be used for Slurm clusters.
Tailscale credentials section of Team Settings with the Acme tailnet credential, its tag:prime-k8s tag, client ID, masked secret, Used by 1 cluster, and Test and delete buttons

A saved credential. Only the client ID is shown; the secret stays masked.

Reserve nodes

  1. Open Dedicated Clusters, or the cluster’s own page
  2. Click Deploy → Kubernetes reservation
  3. Fill in:
    • Cluster: clusters that can’t take a reservation right now are shown but can’t be picked
    • Pool name: lowercase letters, digits and -, at most 22 characters
    • Nodes: the nodes to reserve
    • Members: the teammates who get access
    • Tailscale access: the team credential the proxy joins your tailnet with
  4. Click Reserve nodes
Dedicated Clusters page with the Deploy menu open on Slurm cluster, Inference endpoint and Kubernetes reservation, cluster cards for research-h100 and eval-h200, and the ml-research reservation card with Proxy ready, 4/4 nodes held and 3/3 members ready

The Deploy menu. Existing reservations are listed under Kubernetes Reservations.

Reserve Kubernetes dialog with cluster research-h100, pool name eval-sandbox, and gpu-11 and gpu-12 selected out of four available nodes, above the expanded Unavailable (28) list

Reserving two idle nodes into a new pool.

Reserve Kubernetes dialog scrolled to Members, with Alex Example and Morgan Example selected, and Tailscale access set to Acme tailnet with tag:prime-k8s, above the Reserve nodes button

Lower in the same dialog: members and the Tailscale credential the proxy uses.

Only nodes that can join a reservation right now can be selected. The others are listed under Unavailable, with the reason:
Unavailable list in the Reserve Kubernetes dialog: gpu-10 Running 1 platform workload, gpu-13 to gpu-16 In reservation ml-research, and gpu-17 Claimed by Slurm

Unavailable nodes and why. gpu-13 to gpu-16 are already held by the ml-research reservation.

The reservation then appears under Kubernetes Reservations, on the Dedicated Clusters page and on the cluster’s page. Its API proxy goes from waiting for the cluster, through starting, to Proxy ready once the proxy has joined your tailnet, usually within a couple of minutes. Members can connect once it’s ready. On the cluster page, the reserved nodes form their own Kubernetes group in the Nodes grid and count as in use, so they’re never offered as idle capacity.
Nodes section of the research-h100 cluster page: GPU allocation of 68 idle, 164 in use or reserved and 24 unavailable, with Slurm, Kubernetes and Unassigned node groups; the four Kubernetes nodes are all in use

research-h100 with four nodes (32 GPUs) reserved for Kubernetes.

If the cluster hasn’t reported in recently, the reservation shows Status unavailable. No new credentials are issued until it reports in again. Workloads already running are not affected.

Manage a reservation

Select a reservation to see its nodes, members and proxy. Each member’s namespace is listed next to their name.
ml-research reservation page on research-h100 showing API proxy Proxy ready, 4/4 nodes held, 3/3 members ready, created 3d ago, the Get my kubeconfig button, reserved nodes gpu-13 to gpu-16, and members Alex, Jordan and Taylor Example with their namespaces Active and Ready

The ml-research reservation: four nodes, three members, and the proxy ready.

Team admins can:
  • Add member: the member’s namespace is created, and they can connect once it’s ready.
  • Remove a member: their access is revoked and their namespace is deleted with everything in it.
  • Scale: change the reserved nodes.
    • Nodes being removed are drained: pods on them are evicted, respecting PodDisruptionBudgets, and any still there after 10 minutes are deleted.
    • Before you confirm, the dialog shows which workloads are running on the departing nodes.
  • Release: deletes every member’s namespace with everything in it, then the proxy, then frees the nodes. Prime removes the proxy’s device from your tailnet. This can’t be undone.

Connect

Each member connects from a device on the team’s tailnet.

1. Create an API key

In Settings → API Keys, create a key with Clusters: read and Clusters: write. Write is needed because each kubectl call gets its Kubernetes token with this key.

2. Join the tailnet

Sign the device you’ll run kubectl from in to your team’s tailnet, with Tailscale’s MagicDNS on, so it can reach the proxy.

3. Log in

You need the Prime CLI 0.25.1 or later.
This lists the reservations you’re a member of, with each one’s namespace and status.
login writes one kubeconfig per cluster, with a context for each of your reservations on it. Add --pool <name> to make a particular reservation’s context the current one. Your namespace is the context’s default, so you don’t need -n. Tokens last one hour, and kubectl gets a new one automatically when it needs it. Run prime factory k8s login again if you switch API keys or environments: the kubeconfig only works with the key it was written with.
You can also copy a kubeconfig from the reservation’s page with Get my kubeconfig. It reads your API key from the PRIME_API_KEY environment variable.
Your kubeconfig dialog scoped to pool ml-research on research-h100, showing a kubeconfig with server https://k8s.example.com, the member's namespace as the context default, and an exec command that fetches a token with PRIME_API_KEY

Get my kubeconfig. The server is the reservation's proxy on your tailnet.

Running workloads

You can create and manage, in your namespace:
  • pods, including kubectl exec, logs, attach and port-forward;
  • Deployments, ReplicaSets, StatefulSets, Jobs and CronJobs;
  • Services, ConfigMaps, Secrets, PersistentVolumeClaims and ServiceAccounts;
  • HorizontalPodAutoscalers and PodDisruptionBudgets.

Pod security

Namespaces enforce the Kubernetes restricted Pod Security Standard. A pod must run as a non-root user, drop all capabilities, disallow privilege escalation and use a seccomp profile:
Also not allowed:
  • host networking, PIDs, IPC and hostPath volumes;
  • privileged containers;
  • setting nodeName;
  • terminationGracePeriodSeconds above 300;
  • adding finalizers to your objects.

GPUs

  • Members share the reservation’s GPUs, first come, first served. A pod waits in Pending until enough GPUs are free on one of the reservation’s nodes.
  • A single pod can only use one node’s GPUs. A pod asking for more GPUs than one node has stays Pending.

Networking and Services

  • Inbound traffic is allowed only from your own namespace.
  • Outbound traffic can reach cluster DNS, your own namespace and the public internet, but not private networks, other workloads on the cluster or your tailnet.
  • Services can only be ClusterIP: NodePort, LoadBalancer and externalIPs are not allowed. To reach a service from your machine, use kubectl port-forward.

Storage

A PersistentVolumeClaim must name one of the storage classes your cluster allows, and creates a new volume: it can’t bind to an existing PersistentVolume or clone from another namespace. Contact support to find out which storage classes your cluster allows. Removing a member, or releasing the reservation, deletes the namespace’s PersistentVolumeClaims. Don’t keep anything there you can’t recreate.

Quotas

Each namespace has a quota on object counts and storage:

Node failures

If a node fails, the pods on it are evicted, and Deployments, Jobs and StatefulSets recreate them on the reservation’s other nodes, if there’s room. A bare pod is not recreated, so run anything that should survive a node failure through one of these controllers.

Troubleshooting