Managed Kubernetes

Fleets with managed Kubernetes come with a cluster whose control plane is run by Lightning AI. Your fleet's GPU nodes join the cluster as workers. Use the API to connect kubectl, check cluster health, and take worker nodes in and out of service.

These endpoints return 400 Bad Request for fleets without a managed Kubernetes cluster.

Connect kubectl

The kubeconfig contains a short-lived credential with the customer role. Fetch a new one before expiresAt.

Console

Open the fleet, select the Kubernetes tab, and scroll to the Kubeconfig card. The card appears once the cluster is Ready.

  1. Select Download. The file is saved as <cluster-name>-kubeconfig-customer.yaml.

  2. Follow the card's Quick Start Guide:

    export KUBECONFIG=~/<cluster-name>-kubeconfig-customer.yaml
    kubectl cluster-info
    kubectl get nodes

    Or pass the file directly: kubectl --kubeconfig ~/<cluster-name>-kubeconfig-customer.yaml get nodes.

The Kubeconfig card on a fleet's Kubernetes tab in the console, with a Download button and a Quick Start Guide for setting KUBECONFIG, checking the connection, and listing nodes

API

The response is a JSON envelope. Extract the YAML before using it:

curl "$API_URL/v1/fleets/$FLEET_ID/kubernetes-v2/kubeconfig" -H "Authorization: Bearer $TOKEN" \
  | jq -r '.kubeconfig' > kubeconfig.yaml
chmod 600 kubeconfig.yaml
KUBECONFIG=kubeconfig.yaml kubectl get nodes
{
  "kubeconfig": "apiVersion: v1\nkind: Config\n...",
  "role": "...",
  "expiresAt": "2026-10-15T18:00:00Z",
  "ttlSeconds": 3600
}

Tip

Treat the kubeconfig like a password: keep it at mode 600 and never commit it. In automation, fetch a new one at the start of each job instead of storing it.

Cluster health

Returns overall health plus control-plane components, per-worker health, networking, and API-server-to-worker connectivity. Reads are live.

Console

The fleet's Kubernetes tab shows the cluster's status and details (Kubernetes version, control plane nodes, NVIDIA driver), followed by cluster health for the control plane, networking, and workers.

A fleet's Kubernetes tab in the console, showing cluster status, cluster details such as Kubernetes version and NVIDIA driver, and control-plane health

API

curl "$API_URL/v1/fleets/$FLEET_ID/kubernetes-v2/health" -H "Authorization: Bearer $TOKEN"

Returns 404 when the cluster has no health snapshot yet.

Worker node detail

Returns Kubernetes conditions, GPU information, labels and annotations, taints, and registration timestamps for one worker. It also works for nodes that are registered but have not yet joined.

Console

Open the node's detail page from the fleet's Nodes tab and scroll to the Kubernetes Details section. It shows registration status, Kubernetes status, and whether the node is schedulable. Below that, Conditions lists every Kubernetes and GPU health condition with its status, reason, and last transition.

The Conditions table on a node's detail page in the console, listing GPU, NVLink, NVSwitch, network, memory, disk, and PID conditions, all reported as healthy

API

curl "$API_URL/v1/fleets/$FLEET_ID/kubernetes-v2/nodes/$NODE_ID" -H "Authorization: Bearer $TOKEN"

Cordon, drain, and uncordon worker nodes

Use these before maintenance, such as a power action, and to return a node to service afterwards. The node must have joined the cluster.

Action Effect Response
cordon Marks the node unschedulable. Running pods keep running. 200 OK
drain Cordons the node, then evicts its pods while respecting PodDisruptionBudgets. 202 Accepted
uncordon Makes the node schedulable again. 200 OK

Console

Open the node's detail page from the fleet's Nodes tab. Use Cordon or Drain in the Kubernetes section. After a node is cordoned, uncordon it from the same section.

A node's detail page in the console, with power state, Force Restart and Force Off buttons, a readiness warning, hardware details, and Kubernetes Cordon and Drain buttons

API

# Cordon
curl -X POST "$API_URL/v1/fleets/$FLEET_ID/kubernetes-v2/nodes/$NODE_ID/cordon" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Idempotency-Key: $(uuidgen)"

# Drain (the body is optional)
curl -X POST "$API_URL/v1/fleets/$FLEET_ID/kubernetes-v2/nodes/$NODE_ID/drain" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"gracePeriodSeconds": 60, "ignoreDaemonSets": true}'

# Uncordon
curl -X POST "$API_URL/v1/fleets/$FLEET_ID/kubernetes-v2/nodes/$NODE_ID/uncordon" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Idempotency-Key: $(uuidgen)"

The drain response reports evicted (number of pods evicted) and failed (pods that could not be evicted).

Drain option Description
gracePeriodSeconds Time given to evicted pods before they are forcibly terminated.
ignoreDaemonSets Continue even though DaemonSet pods can't be evicted. They are skipped.
deleteLocalData Accepted for forward compatibility but not currently honored.

Drain returns 409 Conflict while the cluster is restoring or being deleted.

Typical maintenance flow

  1. Drain the worker and confirm failed is empty. An empty failed list only means every eviction request was accepted, not that the pods have stopped.
  2. Poll the worker detail until schedulable is false and drained is true. If drained is missing, the drain isn't confirmed yet, so keep waiting.
  3. Do the maintenance, for example a ForceRestart.
  4. Check that the node is Ready in its worker detail.
  5. Uncordon it.

Was this page helpful?

What went wrong?

↑↓ Navigate↵ Open⌘↵ New tabesc Close