Playbook · DGX Spark cluster

Kubernetes on two DGX Sparks, with GPUs.

Kubernetes runs your services from description files on both Sparks and restarts them when they fail. This page uses K3s, a lighter Kubernetes.

This installs system services that run with full rights and change the Spark's network rules. On Sparks that already do real work, plan a time to do it and know how to remove it.

How to set up Kubernetes with GPUs on two DGX Sparks

  1. Install K3s as the server on the first Spark and as an agent on the second, using the cluster link.
  2. Check that K3s found the NVIDIA container runtime.
  3. Install NVIDIA's device plugin so Kubernetes can schedule each GPU.
  4. Test a GPU pod, then add a model service that stays inside the cluster.

Checked on 26 November 2026 against: Kubernetes (v1.37) and K3s documentation and the NVIDIA Kubernetes device plugin (latest release then: v0.20.2). Of our cluster pages, this one most needs a hardware test. We have not yet run this playbook start to finish on our own hardware.

Watch, then follow

How to set up Kubernetes on two DGX Sparks, in two parts.

Part 1 of 2: Decide and configure

Video, part 1: Decide and configure. It covers: Whole pods only; One server, one agent; Check the extras; Requests and limits; Spreading rules. Chapters and transcript
Read the words of this video

Decide, then configure. Before you install Kubernetes on two DGX Sparks, here's what to decide.

The AI stack. We start with the two machines at the bottom of the stack. Kubernetes manages containers across them.

Whole pods only. The scheduler picks one Spark for each whole pod. It doesn't split one process across both. It can't lend one pod processors from each.

One server, one agent. We use K3s. The first Spark is the server, which can run work too. The second is an agent. With one server, losing it means losing control of the cluster. Our advice: put the same K3s version on both.

Check the extras. K3s also installs a web router and a load balancer, which can open ports on your Sparks. If you don't need them, turn them off when you start the server.

Requests and limits. A request is what the scheduler counts, and what's kept for the container. A processor limit is a ceiling. Reaching it slows the container down. A memory limit can get a process killed when memory runs short.

Spreading rules. Each model pod asks for one GPU, so two can't share one Spark here. Other pods may land together. Add a spread rule if they mustn't. For model updates, we stop the old pods first, because there's no spare GPU.

Decide first. The page lists the settings and defaults. We haven't run this on hardware.

Slides for this part, at your own pace:

10 steps

  1. Diagram for step 1, Kubernetes places whole pods: Whole pods only
    Diagram: Whole pods only, for step 1

    Decide

    1. Kubernetes places whole pods

    Each pod runs on one Spark, with all its containers.

    What is split, and what is not

  2. Diagram for step 2, It does not split one process: Whole pods only
    Diagram: Whole pods only, for step 2

    Decide

    2. It does not split one process

    CPU work reaches both Sparks only if your software runs as several pods that share it. A split model needs another tool.

  3. Diagram for step 3, One server, one agent: One server, one agent
    Diagram: One server, one agent, for step 3

    Decide

    3. One server, one agent

    The first Spark is the K3s server and can also run pods. The second is an agent.

    All the decisions

  4. Diagram for step 4, Choose one version: One server, one agent
    Diagram: One server, one agent, for step 4

    Decide

    4. Choose one version

    Our advice: pick one exact K3s version for both, set with INSTALL_K3S_VERSION, and write it down.

  5. Diagram for step 5, Look at the built-in extras: Check the extras
    Diagram: Check the extras, for step 5

    Configure

    5. Look at the built-in extras

    These can open ports on your Sparks' network addresses.

    K3s installs Traefik, which uses ports 80 and 443, and ServiceLB.

  6. Diagram for step 6, Turn off what you do not need: Check the extras
    Diagram: Check the extras, for step 6

    Configure

    6. Turn off what you do not need

    Add these to the server command. On a cluster in use, check nothing depends on them first.

    --disable=traefik
    --disable=servicelb
  7. Diagram for step 7, Set requests from measurements: Requests and limits
    Diagram: Requests and limits, for step 7

    Configure

    7. Set requests from measurements

    The scheduler places pods by their requests. We give no values.

    CPU and memory settings

  8. Diagram for step 8, Take care with limits: Requests and limits
    Diagram: Requests and limits, for step 8

    Configure

    8. Take care with limits

    A memory limit that is too low can get the model killed.

    A CPU limit slows a container at its ceiling. Neither setting chooses your program's thread count.

  9. Diagram for step 9, Add a spread rule if needed: Spreading rules
    Diagram: Spreading rules, for step 9

    Configure

    9. Add a spread rule if needed

    One GPU request each keeps the two model pods apart. Other pods need their own rule if they must not share a Spark.

    Spreading rules

  10. Diagram for step 10, Plan for updates with a gap: Spreading rules
    Diagram: Spreading rules, for step 10

    Configure

    10. Plan for updates with a gap

    The example uses Recreate: old pods stop before new ones start, because there is no spare GPU.

Part 2 of 2: Set up, check and stop

Video, part 2: Set up, check and stop. It covers: Install the server; Join the agent; Add the plugin; Prove both work; Keep it inside; Uninstalling loses data. Chapters and transcript
Read the words of this video

Set up, check, stop. Now let's install it, check the GPUs, and learn how to remove it.

Install the server. Warning: this installs a system service that changes network rules. Pick a quiet time. Download the installer, and read it first. Then install the server, using the cluster link's address and interface.

Join the agent. Download and read the installer there too. Join with the server's address and token. Treat that token as a password. Keep the cluster ports closed to other networks.

Add the plugin. Check on both that K3s found the NVIDIA runtime. Then install NVIDIA's device plugin, so Kubernetes can give out each GPU.

Prove both work. Both nodes should be ready, on their cluster addresses. Each should offer one GPU. Run the test pod on each, and read its log.

Keep it inside. Add the model service, one copy on each Spark. Keep the service inside the cluster. Other service types can open ports. Wait until both pods are ready, and check where each one runs.

Uninstalling loses data. To stop just the model, scale it to zero. Stopping K3s leaves containers running. Its kill all script stops them. Warning: uninstalling deletes cluster data. Copy what you need first, then remove the agent before the server.

Check, then use. The written page has the commands, fixes and sources.

Slides for this part, at your own pace:

11 steps

  1. Diagram for step 1, Read the installer on both: Install the server
    Diagram: Install the server, for step 1

    Set up

    1. Read the installer on both

    Download it and read it before you run it.

    curl -sfL https://get.k3s.io -o k3s-install.sh
    less k3s-install.sh
  2. Diagram for step 2, Install the server: Install the server
    Diagram: Install the server, for step 2

    Set up

    2. Install the server

    This installs and starts a system service, and changes network rules.

    On the first Spark. Use your own link address and interface, and add the choices you made in part 1.

    sudo sh k3s-install.sh server \
      --node-ip FIRST-SPARK-LINK-ADDRESS \
      --flannel-iface LINK-INTERFACE
  3. Diagram for step 3, Join the second Spark: Join the agent
    Diagram: Join the agent, for step 3

    Set up

    3. Join the second Spark

    This installs a system service. Treat the token as a password.

    Read the token on the first Spark, then type it at the silent prompt on the second.

    read -rs K3S_TOKEN
    sudo env K3S_URL=https://FIRST-SPARK-LINK-ADDRESS:6443 \
      K3S_TOKEN="$K3S_TOKEN" \
      sh k3s-install.sh --node-ip SECOND-SPARK-LINK-ADDRESS \
      --flannel-iface LINK-INTERFACE
    unset K3S_TOKEN
  4. Diagram for step 4, Keep the ports private: Join the agent
    Diagram: Join the agent, for step 4

    Set up

    4. Keep the ports private

    See which ports are listening, and block cluster ports from other networks.

    sudo ss -lntup

    Which ports, and why

  5. Diagram for step 5, Check the NVIDIA runtime: Add the plugin
    Diagram: Add the plugin, for step 5

    Set up

    5. Check the NVIDIA runtime

    If you have to restart a K3s service, cluster management on that node is interrupted.

    On both Sparks.

    sudo grep nvidia /var/lib/rancher/k3s/agent/etc/containerd/config.toml
  6. Diagram for step 6, Install the device plugin: Add the plugin
    Diagram: Add the plugin, for step 6

    Set up

    6. Install the device plugin

    Follow the page: add NVIDIA's chart, label both nodes and install the version you chose.

    The commands, on this page

  7. Diagram for step 7, Count the GPUs: Prove both work
    Diagram: Prove both work, for step 7

    Check

    7. Count the GPUs

    Both nodes Ready, and one GPU on each.

    sudo k3s kubectl get nodes -o wide
    sudo k3s kubectl describe nodes | grep -i 'nvidia.com/gpu'
  8. Diagram for step 8, Run the test pod on each: Prove both work
    Diagram: Prove both work, for step 8

    Check

    8. Run the test pod on each

    The log should end with Test PASSED.

    The test pod file

  9. Diagram for step 9, Add the model service: Keep it inside
    Diagram: Keep it inside, for step 9

    Check

    9. Add the model service

    Leave the Service as ClusterIP. NodePort or LoadBalancer opens a port on the network.

    Create the key and chat.yaml as the page shows, then see which Spark each pod is on.

    sudo k3s kubectl apply -f chat.yaml
    sudo k3s kubectl get pods -o wide -w

    The whole file

  10. Diagram for step 10, Stop only the model: Uninstalling loses data
    Diagram: Uninstalling loses data, for step 10

    Stop

    10. Stop only the model

    Requests fail while it is scaled to nothing.

    sudo k3s kubectl scale deployment chat --replicas=0
  11. Diagram for step 11, Back up, then uninstall: Uninstalling loses data
    Diagram: Uninstalling loses data, for step 11

    Undo

    11. Back up, then uninstall

    Uninstalling can lose data: the cluster database, local volume data and node settings.

    Copy out what you need. Then follow the page: your objects, the second Spark, then the first.

    The removal steps

Is this the one?

Is Kubernetes worth it on two DGX Sparks?

Best for

People who already use Kubernetes, or who run many services and want them described in files and restarted automatically.

Strengths

Restarts failed containers, gives services stable names inside the cluster, and keeps track of which GPU is in use.

Drawbacks

The most to learn and update. With one server node, losing it means losing control of the cluster; K3s's high-availability setup with its built-in database needs three or more server nodes. It does not split a model for you.

Compare all five in the cluster method chooser.

Before you start

What you need first.

Two DGX Sparks on the same current DGX OS, with the cable link set up and tested as in the cluster setup guide. In the commands, my-spark is the first Spark, spark-two the second, and USER your user name. Replace words in capitals with your own values. Nothing on this page has been run by us on hardware.

A Spark's GPU used by an ordinary Docker container is not counted by Kubernetes, so stop GPU containers you started outside it before you schedule GPU pods. You also need Helm on the first Spark.

Another route: the upstream tool kubeadm builds standard Kubernetes. It leaves more to you: a container runtime it can talk to (Docker alone needs an adapter), a pod network add-on, and the swap setting, because the kubelet by default will not start with swap on. We chose K3s here because it brings a runtime and pod network with it.

How it fits together

One server node and one agent node.

Service: chat-apiinside the clustermy-spark: K3s servercontrols the clusterspark-two: K3s agentjoins with a tokenModel pod1 GPUModel pod1 GPU
The two-copies layout inside Kubernetes: one pod on each Spark, because each has one GPU. Our own drawing.

Decide first

What to decide before you install Kubernetes on two DGX Sparks.

Settings in the next four sections were checked on 27 November 2026 against the Kubernetes documentation (v1.37) and the K3s documentation. None of them has been run by us on DGX Spark hardware. The install steps below use the choices this table calls ours.

DecisionYour choicesWhat to weigh
Which KubernetesK3s or kubeadmThis page uses K3s (our choice). See the other route.
Node rolesOne server and one agentThe first Spark controls the cluster, and K3s says a server also runs workloads, so both GPUs can be used. Lose the server and you lose cluster control. Two nodes are not enough for K3s’s embedded high-availability setup.
K3s versionA channel or one exact versionThe installer takes the stable channel unless you set INSTALL_K3S_CHANNEL or INSTALL_K3S_VERSION. Our advice: install the same exact version on both and write it down.
Network for the clusterThe cluster link or another networkThis page uses the cable link for node and pod traffic.
K3s’s built-in web router and load balancerKeep or turn off Traefik and ServiceLBK3s installs both. Traefik uses ports 80 and 443, and ServiceLB opens a Service’s port on the nodes. If you do not need them, K3s says to start every server with --disable=traefik and --disable=servicelb. With ServiceLB off, a LoadBalancer Service stays pending but still gets a node port.
GPU runtimePer pod, or default on a nodeThis page puts runtimeClassName: nvidia in each GPU pod. K3s also has --default-runtime to make a runtime the default. NVIDIA’s plugin README describes the NVIDIA runtime as the default, while K3s shows the per-pod way; we have run neither on a Spark.
How the model uses two SparksA copy on each, or one split modelA Deployment gives you copies. A split model needs another tool.
CPU and memoryRequests, limits or neitherSee CPU and memory settings.
PlacementLet the scheduler choose, or give it rulesSee spreading.

Unless you turn them off, K3s installs services that can open ports on your Sparks’ network addresses. Decide before you install. K3s says --disable also removes a packaged component that is already deployed, so on a cluster in use, check that nothing depends on it first.

K3s settings and their defaults.

SettingDefaultWhat it controls and when to change it
--node-ipNot setThe address the node advertises. We set each Spark’s cluster link address
--flannel-ifaceNot setThe interface the pod network uses instead of its usual one. We set the cluster interface
--flannel-backendvxlanHow pod traffic crosses between nodes. Keep the default unless you know why not. The ports needed change with it
--bind-addressEvery interfaceThe address K3s listens on. We have not tested narrowing it; block the ports from other networks
--write-kubeconfig-mode600, owned by rootWho can read the admin file. Keep it: that file controls the whole cluster
--node-name or K3S_NODE_NAMEThe host nameTwo nodes cannot have the same name
K3S_URL, K3S_TOKENNot setWith a URL, the installer sets up an agent. The agent also needs the token

Options can also go in /etc/rancher/k3s/config.yaml, as K3s’s configuration page shows. From the server options, the quick start and the requirements. K3s’s requirements page recommends turning off ufw and firewalld, or adding rules if you keep them. We do not advise turning a firewall off: if yours is on, keep it, and use that page to work out the rules. We have not tested any.

Automatic or not

What Kubernetes splits between two DGX Sparks, and what it does not.

Kubernetes places whole pods. It does not split one process, or one pod, across both Sparks. A pod’s containers are always placed together, on one node. CPU work moves to the second Spark only if your software runs as more than one pod, or coordinates over the network by itself.

Schedulerpicks one node for each whole podPod A, all of it, on my-sparkits processes stay heremy-spark: its own CPU, memory, GPUnot added to the other SparkPod B, all of it, on spark-twoits processes stay herespark-two: its own CPU, memory, GPUnot added to the other Sparkno single process or pod spans the two
Kubernetes shares out whole pods between the two Sparks, not the work inside one pod. Our own drawing.
JobDone by KubernetesWhat you or your software must do
Choosing a nodeThe scheduler drops nodes that cannot run the pod, scores the rest and picks one; ties are broken at randomState what the pod needs, and add rules if it must go somewhere in particular
Several copiesA Deployment keeps the number of pods you ask for (default 1)Set replicas. Copies do not share one model’s memory
Spreading copiesThe scheduler prefers to spread by default, but that is not a promiseAdd a rule if two copies must not share a Spark
Requests to a serviceA Service sends traffic to its ready podsUse the Service name. Your program must cope with any pod answering
One program’s CPU workNot splitRun it as several pods that each take part of the work, with your own way to divide it
CPU threads inside a podNot chosen for you by these settingsSet them with your software’s own options
A model too big for one SparkNot split by a DeploymentUse software that splits models, and a tool that starts its pods together
Moving a running podA running pod is not moved to even things outA replacement is a new pod, which is scheduled again
Model files and imagesThis page’s hostPath folder is that Spark’s own folder; Kubernetes does not copy itMake the files available on each Spark

CPU and memory

How to set CPU and memory requests and limits for pods.

Each Spark has a 20-core processor and 128 GB of memory shared with the GPU. In Kubernetes, one CPU unit is one core on a physical machine, and 500m is half of one. Neither a request nor a limit chooses how many threads your program starts.

SettingWhat it controlsIf you leave it outWhen to change it
CPU requestWhat the scheduler counts, and the CPU kept for the container. It may use more if the node has some freeNo CPU is reserved, unless a limit or a cluster default supplies a requestSet it to what the program needs to keep working when others are busy. Measure first
CPU limitA hard ceiling, enforced by slowing the container (throttling)No ceiling from this settingWhen one pod must not take CPU others need. A low limit can slow data work
Memory requestWhat the scheduler counts for memoryNothing reserved, unless a limit or a cluster default supplies itFrom measured use
Memory limitA ceiling the Linux kernel enforces by killing processes when it detects memory pressureNo ceiling from this settingWith care on a Spark, whose memory is shared with the GPU
nvidia.com/gpuGPUs for the container, in whole numbers, never overcommittedThe pod is not counted as using a GPUAlways set it, as a limit. If you also give a request, it must be the same

The When to change it column is our advice.

If you give a limit and no request, and nothing else adds a default, Kubernetes copies the limit into the request. The scheduler places pods by what they request, and does not give out more than the node’s allocatable amount. To hold resources back for the operating system and Kubernetes, the kubelet has systemReserved and kubeReserved; we have not tested setting either on K3s.

We have not checked how memory the GPU uses is counted against a container’s memory limit on DGX Spark. Do not treat that limit as a cap on model memory.

To try requests and limits, add them beside the GPU line in chat.yaml. Replace every word in capitals with a value from your own measurements. We give none:

          resources:
            requests:
              cpu: "CPU-REQUEST"
              memory: MEMORY-REQUEST
            limits:
              cpu: "CPU-LIMIT"
              memory: MEMORY-LIMIT
              nvidia.com/gpu: 1

Applying a change to the pod description replaces the model pods. With Recreate, all of them stop first, so requests fail until the new ones are ready. A memory limit that is too low can get the model killed.

Quality of service and fixed CPU cores.

Kubernetes gives each pod a class. Guaranteed needs every container to have CPU and memory requests and limits, with each request equal to its limit. BestEffort has none. Most others are Burstable. When a node runs short, BestEffort pods are first in line to be evicted.

The kubelet’s CPU manager policy is none by default, so these containers are not pinned to their own cores. Its static policy gives whole cores only to containers in Guaranteed pods that request a whole number of CPUs, and needs some CPU reserved for the system. Changing it on a working node means draining the node, stopping the kubelet and removing its saved CPU state. We have not tried it with K3s and give no steps.

Threads and shared memory inside a pod.

Our advice: set your software’s thread and worker options to suit the CPU you gave the pod, through its arguments or an env entry such as OMP_NUM_THREADS, if it reads one. Check what it really starts. For a training job, see PyTorch’s CPU settings.

The shm volume in this page’s example is held in memory. What it stores counts as the pod’s memory use. With no sizeLimit, it can grow to the pod’s memory limit, if that is set for every container or for the pod, and otherwise up to the node’s allocatable memory.

Placement

How to control which DGX Spark each pod runs on.

Two pods that each ask for a GPU cannot both fit on a Spark that offers one, so this page’s model pods end up one on each. Pods without a GPU request have no such guarantee. With no cluster settings of its own, the scheduler uses soft default spreading rules: for host names, a difference of up to 3 matching pods, and ScheduleAnyway.

RuleWhat it doesWatch for
nodeSelectorOnly nodes with all the listed labelsThe pod waits if none match
Node affinityA required rule, or a preference, about node labelsA preference can be ignored when no node matches
Pod anti-affinityKeeps matching pods apart, for example by kubernetes.io/hostnameA required rule leaves extra pods pending
Topology spreadLimits the difference in matching pods between nodes with maxSkew. whenUnsatisfiable is DoNotSchedule by default; ScheduleAnyway makes it a preferenceRules apply when a pod is placed. Removing pods can leave them uneven
nodeNameNames the node and bypasses the schedulerThe pod can fail if that node lacks room

To ask for an even spread of the app: chat pods, this goes under the template’s spec, level with containers. We have not applied it on hardware:

      topologySpreadConstraints:
        - maxSkew: 1
          topologyKey: kubernetes.io/hostname
          whenUnsatisfiable: DoNotSchedule
          labelSelector:
            matchLabels: {app: chat}

See also assigning pods to nodes.

Updates, restarts and a lost Spark.

SettingDefaultWhat it means here
strategy.typeRollingUpdate, with maxSurge and maxUnavailable 25%With 2 replicas, those round to one extra pod and none unavailable. The extra pod would need a third GPU, so the update could not finish. We use Recreate, which stops all old pods first. By Kubernetes’s rules, maxSurge: 0 with maxUnavailable: 1 should instead update one at a time; we have not run it
Startup probe periodSeconds, failureThreshold10 seconds; 3 failures (API source)The defaults allow only about 30 seconds. The example’s 360 failures at 10 seconds allow about an hour. Set it from how long your model takes to load
Time before eviction from an unreachable or not-ready node300 seconds, added by KubernetesAfter about five minutes pods are marked for eviction. A replacement GPU pod has nowhere to go while the other Spark’s GPU is taken. If the lost Spark is the server, the cluster cannot make these decisions

Applying a manifest that has replicas: 2 also undoes a replica count you changed earlier with kubectl scale.

Set up

How to install K3s on two DGX Sparks.

  1. Download the installer and read it, on both.

    curl -sfL https://get.k3s.io -o k3s-install.sh
    less k3s-install.sh
  2. Install the server on the first Spark.

    --node-ip and --flannel-iface put the traffic between nodes and between pods on the cluster link.

    This installs and starts a system service, and changes network rules.

    sudo sh k3s-install.sh server \
      --node-ip FIRST-SPARK-LINK-ADDRESS \
      --flannel-iface LINK-INTERFACE
    sudo k3s kubectl get nodes

    Replace LINK-INTERFACE, here and on the second Spark, with the name of the cluster link interface that is up (for example enp1s0f1np1).

    If you decided against Traefik or ServiceLB, add --disable=traefik or --disable=servicelb to this server command. If you chose an exact K3s version, set INSTALL_K3S_VERSION to it for the installer on both Sparks, inside the sudo command, for example sudo env INSTALL_K3S_VERSION=YOUR-VERSION sh k3s-install.sh server followed by the same options; for the agent, add it after sudo env in the next step.

  3. Join the second Spark.

    The join token is in /var/lib/rancher/k3s/server/node-token on the first Spark; read it with sudo cat. On the second Spark:

    Treat the token as a password. This also installs a system service.

    read -rs K3S_TOKEN
    sudo env K3S_URL=https://FIRST-SPARK-LINK-ADDRESS:6443 \
      K3S_TOKEN="$K3S_TOKEN" \
      sh k3s-install.sh --node-ip SECOND-SPARK-LINK-ADDRESS \
      --flannel-iface LINK-INTERFACE
    unset K3S_TOKEN
  4. Keep the ports private.

    K3s lists TCP 6443 for the API, UDP 8472 for the default pod network between nodes, and TCP 10250 for the kubelet. K3s warns that port 8472 must never be open to others, because it gives access to the cluster network. By default the API listens on every interface, so check with sudo ss -lntup and block these from other networks. Never share the admin file /etc/rancher/k3s/k3s.yaml.

  5. Check K3s found the NVIDIA runtime, on both.

    sudo grep nvidia /var/lib/rancher/k3s/agent/etc/containerd/config.toml

    K3s adds it when it finds NVIDIA's runtime installed. If nothing prints, check the NVIDIA Container Toolkit and restart the K3s service (k3s on the first, k3s-agent on the second).

    Restarting these services interrupts cluster management on that node.

  6. Install NVIDIA's device plugin.

    Kubernetes needs a vendor device plugin before it can schedule GPUs. On the first Spark, add NVIDIA's Helm chart and see which versions exist:

    export KUBECONFIG=/etc/rancher/k3s/k3s.yaml
    sudo helm --kubeconfig "$KUBECONFIG" repo add nvdp \
      https://nvidia.github.io/k8s-device-plugin
    sudo helm --kubeconfig "$KUBECONFIG" repo update
    sudo helm search repo nvdp --versions
    sudo k3s kubectl label node my-spark spark-two nvidia.com/gpu.present=true
    sudo helm --kubeconfig "$KUBECONFIG" upgrade -i nvdp \
      nvdp/nvidia-device-plugin \
      --namespace nvidia-device-plugin --create-namespace \
      --version VERSION --set runtimeClassName=nvidia

    Use your own node names as get nodes shows them. The label is one the chart accepts to force it onto a node, when no feature-detection add-on is installed.

    Not yet proven by us: NVIDIA lists DGX Spark as a supported platform for its GPU Operator, a larger tool we do not set up here. We have not run the plugin with K3s on a Spark.

Check

How to check Kubernetes can use both GPUs.

sudo k3s kubectl get nodes -o wide
sudo k3s kubectl describe nodes | grep -i 'nvidia.com/gpu'

To see what the scheduler has to work with, and what pods have asked for:

sudo k3s kubectl describe node my-spark
sudo k3s kubectl describe node spark-two

Read Allocatable and Allocated resources. The second lists requests and limits, not what is being used now. After you add the model service, this shows each pod’s class:

sudo k3s kubectl get pods -l app=chat \
  -o custom-columns=NAME:.metadata.name,NODE:.spec.nodeName,QOS:.status.qosClass

Success is two nodes marked Ready, with their cluster link addresses, and one nvidia.com/gpu on each. Then run a test pod. This one is adapted from the device plugin's README; save it as gpu-test.yaml:

apiVersion: v1
kind: Pod
metadata:
  name: gpu-test
spec:
  restartPolicy: Never
  runtimeClassName: nvidia
  containers:
    - name: cuda
      image: nvcr.io/nvidia/k8s/cuda-sample:vectoradd-cuda12.5.0
      resources:
        limits:
          nvidia.com/gpu: 1
sudo k3s kubectl apply -f gpu-test.yaml
sudo k3s kubectl get pod gpu-test -o wide
sudo k3s kubectl logs gpu-test
sudo k3s kubectl delete pod gpu-test

The log should end with Test PASSED. We have not confirmed this sample image on a DGX Spark; if it will not run, read describe pod before blaming the setup. Add nodeName under spec to test each node in turn.

A model service

How to run a model on each node behind one Service.

This is a copy on each Spark as Kubernetes objects. First store the API key, typed so it stays out of your shell history:

read -rs KEY
sudo k3s kubectl create secret generic chat-key \
  --from-literal=api-key="$KEY"
unset KEY

Save as chat.yaml, replacing the capitals:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: chat
spec:
  replicas: 2
  strategy:
    type: Recreate
  selector:
    matchLabels: {app: chat}
  template:
    metadata:
      labels: {app: chat}
    spec:
      runtimeClassName: nvidia
      containers:
        - name: vllm
          image: VLLM-IMAGE:TAG
          command: ["vllm", "serve"]
          args: ["ORG/MODEL"]
          env:
            - name: VLLM_API_KEY
              valueFrom:
                secretKeyRef: {name: chat-key, key: api-key}
          ports:
            - containerPort: 8000
          resources:
            limits:
              nvidia.com/gpu: 1
          startupProbe:
            httpGet: {path: /health, port: 8000}
            periodSeconds: 10
            failureThreshold: 360
          readinessProbe:
            httpGet: {path: /health, port: 8000}
          volumeMounts:
            - {name: models, mountPath: /root/.cache/huggingface}
            - {name: shm, mountPath: /dev/shm}
      volumes:
        - name: models
          hostPath: {path: /home/USER/.cache/huggingface}
        - name: shm
          emptyDir: {medium: Memory}
---
apiVersion: v1
kind: Service
metadata:
  name: chat-api
spec:
  type: ClusterIP
  selector: {app: chat}
  ports:
    - port: 8000
      targetPort: 8000
sudo k3s kubectl apply -f chat.yaml
sudo k3s kubectl get pods -o wide -w

Expect one pod on each Spark to become ready. Recreate is used because there is no spare GPU for a replacement to start on during an update; it means updates have a gap. A hostPath folder gives the pod access to that folder on the Spark. A gated model also needs a token in a second secret. The vLLM Kubernetes page shows more options.

Leave the Service as ClusterIP. A NodePort or LoadBalancer service opens a port on the Sparks' network addresses.

For a quick test, forward a port to the Spark itself and tunnel to it. A port-forward goes to one pod, so it does not show the sharing; apps running inside the cluster use the Service name and are shared between the pods.

sudo k3s kubectl port-forward service/chat-api 8000:8000

A split model is a different job: two pods that must start and stop together. That takes a tool built for it: SGLang documents deploying on Kubernetes with LeaderWorkerSet, and vLLM points to KubeRay. You would also need the settings from the split-model page or the Ray page. Two replicas in a Deployment do not split anything. We give no split manifest because we have not verified one.

Stop and undo

How to stop and remove Kubernetes.

To stop only the model, scale it to nothing; start it again with 2:

sudo k3s kubectl scale deployment chat --replicas=0

K3s says that stopping its service leaves containers running. Its kill-all script, /usr/local/bin/k3s-killall.sh, stops them all and keeps the cluster data. To stop a node's service as well: sudo systemctl stop k3s-agent on the second, sudo systemctl stop k3s on the first. They start again at the next boot unless disabled.

Uninstalling can lose data. K3s says its uninstall scripts delete the cluster's local database, local volume data, node settings and tools. Copy out what you need first.

To undo: delete your objects, remove the second node, then the first.

sudo k3s kubectl delete -f chat.yaml
sudo k3s kubectl delete secret chat-key
sudo k3s kubectl drain spark-two --ignore-daemonsets \
  --delete-emptydir-data

# on the second Spark
sudo /usr/local/bin/k3s-agent-uninstall.sh

# on the first Spark
sudo k3s kubectl delete node spark-two
sudo /usr/local/bin/k3s-uninstall.sh

Check afterwards that your link and your other containers still work.

Problems

If a node or GPU does not show up.

What you seeWhat to try
The second node never appearsCheck the token, and that port 6443 on the first Spark is reachable over the link. Read sudo journalctl -u k3s-agent.
No nvidia.com/gpu on a nodeCheck the runtime line, the node label and the plugin pod's log.
Pod stays Pendingdescribe pod gives the reason. Each Spark has one GPU, so a third GPU pod waits.
Pod stays Pending and the reason says not enough CPU or memoryCompare its requests with what describe node shows as allocatable and already requested.
A pod is slow although the Spark looks idleCheck for a low CPU limit, and how many threads the software starts.
A container restarts and shows OOMKilledCompare the memory limit with what the program needs, including the shared memory volume.
An update never finishes, with a new pod PendingCheck the update strategy: with one GPU on each Spark there is no spare for an extra pod.
Pods on different Sparks cannot talkCheck UDP 8472 between the two over the link and the interface name.

More: cluster problems by symptom.

Next

Keep going.

About Server AI Hub

Server AI Hub is our app for looking after a DGX Spark. You do not need it to follow this playbook. It is coming soon to the App Store and the Microsoft Store.

See what Server AI Hub does

Sources

Check the makers’ own pages.

Read on 26 and 27 November 2026. These projects change often; if their pages differ from this one, follow them.

General guidance only, in our own words. Back up before you start; you use these steps at your own risk. NVIDIA, DGX, DGX Spark, ConnectX and CUDA are trademarks of NVIDIA Corporation; Kubernetes, K3s, Ray, PyTorch, vLLM, SGLang, NGINX, Docker and other names belong to their owners. 6ixLabs is not affiliated with or endorsed by NVIDIA or any of these projects.