Kubernetes v1.37 and Workload-Aware Scheduling: How the Scheduler Learned to Run Distributed AI Jobs Atomically and HierarchicallyLongread · digest for November 30
Isometric 3D cutaway of a modular data center server rack showing synchronous batch allocation of compute nodes for distributed AI workloads
Longread7 sections≈ 25 min

Kubernetes v1.37 and Workload-Aware Scheduling: How the Scheduler Learned to Run Distributed AI Jobs Atomically and Hierarchically

Kubernetes v1.37 (released in early September 2026) brings a major upgrade to Workload-Aware Scheduling, which plans entire workloads instead of isolated containers. The core Workload and PodGroup APIs, gang scheduling, group preemption, and shared DRA hardware claims have all graduated to Beta. On top of that, the release adds the hierarchical CompositePodGroup object, multi-level topology, and a native .spec.scheduling block right inside a standard Job.

Historically, the default kube-scheduler sees the world one pod at a time: one pod, one decision. That works fine for regular web services and APIs. But the moment you deploy distributed neural network training on PyTorch or Megatron-LM, which needs one driver pod and eight GPU workers, pod-by-pod logic breaks down.

Imagine a cluster with eight free GPUs and two identical jobs, each requiring six cards. The scheduler picks the first job, places four of its pods on free nodes, then switches to the second job and places four more. Now the cluster is out of space. Both jobs are stuck: neither can start training because it lacks workers, yet each holds expensive GPUs hostage. This is a classic partial-placement deadlock. In v1.37, the WG Workload-Aware Scheduling team brings mature tools directly into the standard scheduler to solve this problem without forcing you to replace it with a third-party engine.

Why Pod-by-Pod Scheduling Breaks and What Reached Beta

To avoid deadlocks, the scheduler needs to know which pods belong to the same team and cannot run without one another. Kubernetes v1.36 split this concept into two resources: a static Workload template and a live runtime PodGroup object that collects a specific set of pods. In v1.37, both APIs moved to scheduling.k8s.io/v1beta1, just one step away from GA. You can read the core mechanics in the official PodGroup Scheduling documentation and KEP-4671.

The principle itself is called gang scheduling (all-or-nothing batch scheduling). The scheduler evaluates the group as a whole. If the cluster has enough resources for at least minCount pods, it binds them to nodes together. If not, it launches none of them, leaving GPUs free for jobs that actually fit.

Early testers who tried this feature in v1.36 will need to update their manifests. The previous alpha version v1alpha2 has been completely removed and replaced with v1alpha3. This is a breaking change because the authors cleaned up the field structure around disruptionMode, a rename we'll look at shortly.

Under the hood, two quiet but very useful improvements landed. First is native PodGroup queuing. In v1.36, the scheduler still placed every pod into its scheduling queue individually, even when they belonged to the same PodGroup. As a result, members of one team could move through the queue at different speeds and stall each other. In v1.37, the top-level PodGroup enters the queue as a single unit. All pods inside share the same queuing behavior, and developers now have a foundation for smarter group prioritization.

The second change is mutable minCount for elastic jobs. Previously, the minimum group size minCount was locked in when the PodGroup was created. If you wanted to shrink or grow the minimum on the fly, you had to recreate the object. In v1.37, minCount can be updated at runtime. For elastic training, this is a lifesaver: a controller can lower requirements when nodes are scarce or expand the group without killing running pods.

Preemption Without Redundant Loops: How Workload-Aware Preemption Was Rebuilt

Launching a whole group is only half the battle. The second half starts when the cluster is completely full and an urgent high-priority job arrives. That's where preemption kicks in to evict lower-priority pods and free up space. Standard Kubernetes preemption picks victims one node at a time and handles distributed groups poorly. To fix this, gang scheduling gained Workload-Aware Preemption (WAP), described in KEP-5710.

In Kubernetes v1.37, the separate WorkloadAwarePreemption flag was removed and merged directly into GenericWorkload. Smart preemption now ships with the Workload/PodGroup beta. At the same time, the algorithm was sped up significantly and several rough edges from the previous version were smoothed out.

Look at how the victim reprieval phase works. When a high-priority group (the preemptor) doesn't fit in the cluster, the scheduler mentally removes all potential eviction candidates and checks if the newcomer fits. If it does, a reverse pass begins: the scheduler tries to restore as many victims as possible so it doesn't kill healthy pods unnecessarily.

In v1.36, this check was expensive. For every single victim, the scheduler re-ran the entire placement algorithm for the preemptor to verify it still fit. In a large cluster, that turned into a heavy loop. In v1.37, the logic was flipped: placement for the newcomer runs exactly once, its pods are locked onto the chosen nodes as assumed, and then for each victim the scheduler asks just one question: can this specific victim fit back onto its old node alongside the assumed newcomer? Computation drops dramatically without causing extra evictions.

What Changed in WAPKubernetes v1.36Kubernetes v1.37
Feature gateSeparate WorkloadAwarePreemptionMerged into GenericWorkload (Beta)
Victim reprievalFull scheduler rerun per victimSingle preemptor pass with targeted per-victim check
Default preemption vs. PodGroupIgnored disruptionMode, could evict a single podRespects PodGroup disruptionMode
disruptionMode mode namesPodGroup and Podall and single
PodGroup right to preemptImplicit: as long as no pod had NeverExplicit preemptionPolicy field (Alpha)

The team also closed an annoying gap in standard single-pod preemption. In v1.36, the default preemption mechanism knew nothing about PodGroup and would happily evict one random worker from someone else's training job, even if the group had a strict rule to evict only as a whole. The distributed training job still crashed while the remaining seven pods sat idle. In v1.37, default preemption respects the group's disruptionMode.

Along the way, the disruptionMode values were renamed to avoid tying them to the word PodGroup and to keep vocabulary consistent across all hierarchy levels. PodGroup and Pod became all and single. And for teams that need strict control over whether a group can preempt others, an alpha preemptionPolicy field landed directly on PodGroup (behind the PodGroupPreemptionPolicy flag). Previously, the scheduler checked every pod inside and allowed preemption as long as none had preemptionPolicy: Never. Now you can set that decision explicitly at the group level.

A Tree Instead of a Flat List: Why CompositePodGroup Arrived

A flat PodGroup works fine when all pods in a job are identical, like eight uniform workers. Real AI workloads and complex batch pipelines are almost always heterogeneous. Distributed training has a driver pod and a group of workers. Large language model inference via LeaderWorkerSet (LWS) runs a leader pod alongside a pack of workers, and JobSet coordinates several linked Job objects at once.

For those workloads, Kubernetes v1.37 introduces the CompositePodGroup API in alpha (scheduling.k8s.io/v1alpha3). While PodGroup manages a flat list of pods, CompositePodGroup manages a tree of other groups, including leaf PodGroup objects and nested CompositePodGroup objects. The scheduler evaluates the entire tree as a single unit.

Patent-drawing-style tree diagram of CompositePodGroup showing a hierarchy of a root group, workers, and a driver

Workload (example-workload)
 └─ CompositePodGroup: example-root-group (gang, minGroupCount: 2)
     ├─ PodGroup: example-workload-workers (gang, minCount: 4)
     │   └─ 4 worker pods
     └─ PodGroup: example-workload-driver  (gang, minCount: 1)
         └─ 1 driver pod

To describe this hierarchy, Workload gained a spec.compositePodGroupTemplates field. Inside a parent group template, you nest child podGroupTemplates or another layer of compositePodGroupTemplates. Take an end-to-end distributed training example where we need 4 workers and 1 driver launched strictly together.

# Two-level workload template in scheduling.k8s.io/v1beta1
apiVersion: scheduling.k8s.io/v1beta1
kind: Workload
metadata:
  name: example-workload
spec:
  compositePodGroupTemplates:
    - name: workload-root
      schedulingPolicy:
        gang:
          # Both child groups must fit together
          minGroupCount: 2
      podGroupTemplates:
        - name: workers
          schedulingPolicy:
            gang:
              # At least 4 worker pods
              minCount: 4
        - name: driver
          schedulingPolicy:
            gang:
              # Plus 1 driver pod
              minCount: 1

When a controller creates a concrete run from this template, it stamps out the runtime objects: one root CompositePodGroup and two leaf PodGroup objects that point to their parent via parentCompositePodGroupName.

# Root composite group (Alpha, v1alpha3)
apiVersion: scheduling.k8s.io/v1alpha3
kind: CompositePodGroup
metadata:
  name: example-root-group
spec:
  workloadRef:
    workloadName: example-workload
    templateName: workload-root
  schedulingPolicy:
    gang:
      minGroupCount: 2
---
# Leaf worker group linked to the root
apiVersion: scheduling.k8s.io/v1beta1
kind: PodGroup
metadata:
  name: example-workload-workers
spec:
  parentCompositePodGroupName: example-root-group
  workloadRef:
    workloadName: example-workload
    templateName: workers
  schedulingPolicy:
    gang:
      minCount: 4
---
# Leaf driver group linked to the same root
apiVersion: scheduling.k8s.io/v1beta1
kind: PodGroup
metadata:
  name: example-workload-driver
spec:
  parentCompositePodGroupName: example-root-group
  workloadRef:
    workloadName: example-workload
    templateName: driver
  schedulingPolicy:
    gang:
      minCount: 1

How does kube-scheduler process this structure? It walks the tree recursively top-down, from root to leaves. The root CompositePodGroup is ready to run only if its own policy is satisfied—here, at least minGroupCount: 2 child groups must fit. Each child group, in turn, passes only if all of its pods fit (4 workers and 1 driver). Once a valid layout is found for the entire tree, pods are bound to nodes atomically. If even one driver pod doesn't fit, the whole hierarchy waits, and no worker wastes someone else's GPUs.

Preemption works across the entire tree as well, in both directions. A CompositePodGroup can preempt lower-priority workloads or become a victim itself. Its fate is controlled by disruptionMode:

  • single (the default if omitted) allows evicting child groups independently without touching sibling branches;
  • all locks the whole subtree together: if freeing space requires evicting even one pod in any child group, the scheduler evicts the entire hierarchy.

Top-Down Topology: Placing Workloads by Zone and Rack

In distributed training, simply giving eight workers a GPU each isn't enough. If four pods land in one availability zone and four land in another, training hits network bottlenecks and expensive accelerators sit idle waiting for gradient sync. The same applies to server racks, switches, and fast interconnects like NVLink or InfiniBand.

Kubernetes addresses this with Topology-Aware Scheduling (TAS, KEP-5732), which places groups using the cluster's physical map. In v1.36, TAS only worked on a single flat level: binding one PodGroup to one zone or rack. In v1.37, alongside CompositePodGroup, multi-level topology arrived (currently in Alpha).

Now constraints can be set at each tier of the tree. Suppose our job scales up to 8 workers and 1 driver. We want the entire workload to live in one availability zone (topology.kubernetes.io/zone), and inside that chosen zone, all 8 workers should pack tightly into a single server rack (topology.example.com/rack), with the driver also getting a rack in the same zone.

# Multi-level topology: zone at the root, racks at the leaves
apiVersion: scheduling.k8s.io/v1beta1
kind: Workload
metadata:
  name: multi-level-tas-workload
  namespace: job-ns
spec:
  compositePodGroupTemplates:
    - name: root
      schedulingPolicy:
        gang:
          minGroupCount: 2
      schedulingConstraints:
        topology:
          # The entire hierarchy must land in one zone
          - key: topology.kubernetes.io/zone
      podGroupTemplates:
        - name: workers
          schedulingPolicy:
            gang:
              minCount: 8
          schedulingConstraints:
            topology:
              # All 8 workers in one rack inside that zone
              - key: topology.example.com/rack
        - name: driver
          schedulingPolicy:
            gang:
              minCount: 1
          schedulingConstraints:
            topology:
              # Driver in a rack inside the same zone
              - key: topology.example.com/rack

The scheduler solves this puzzle top-down. First, it evaluates candidate zones in the cluster for the root tas-workload-root. Once a zone is selected for trial, the search space for child groups tas-workload-workers and tas-workload-driver narrows strictly to nodes inside that zone. Within it, the scheduler groups nodes by the topology.example.com/rack label and checks valid combinations until it finds a layout that satisfies every tier.

To feel the difference between pod-by-pod scheduling, hierarchical CompositePodGroup with multi-level topology, and the two disruptionMode settings, try the interactive simulator below. Switch to 8 workers or trigger single-worker preemption under single and all.

CompositePodGroup Simulator: Zone, Racks, Gang, and Preemption

Notice what happens with 8 workers and the default sliders. In pod-by-pod mode, pods scatter across both zones, and if a couple of cards are missing, the job locks up other workloads' GPUs. In CompositePodGroup mode, the scheduler keeps the entire hierarchy Pending until one zone has a rack large enough, and the moment space opens up, it claims the whole tree at once. Single-level TAS also received performance optimizations in v1.37 to reduce the compute cost of evaluating placement options.

Shared Building Blocks for Controllers, workloadbuilder, and Native Job

Nobody in their right mind wants to hand-write bundles of Workload, CompositePodGroup, and multiple PodGroup objects for every training run. Controllers handle that—the built-in Job controller and external operators like JobSet (jobset.x-k8s.io), LeaderWorkerSet (leaderworkerset.x-k8s.io), or Kubeflow TrainJob. However, if every operator author invents their own dialect for scheduling policies and translates them differently into scheduling.k8s.io objects, the ecosystem quickly fragments.

Kubernetes v1.37 solves this with two additions: a set of standard building-block types and the Go library workloadbuilder (KEP-6089).

The types fall into two families: WorkloadPodGroup* for leaf pod groups and WorkloadCompositePodGroup* for groups of groups. Each family provides four building blocks:

  • *SchedulingPolicy — chooses between basic (standard one-by-one launch) and gang with a minCount threshold (or minGroupCount for composite groups);
  • *SchedulingConstraints — topology[].key constraints that keep pods packed together;
  • *DisruptionMode — single or all preemption mode;
  • *ResourceClaim — shared DRA hardware claims for the entire group.

A nice design choice: controllers only share the shape of these types, while each operator decides how to name and nest fields in its own API. Translating those fields into actual Kubernetes objects is handled by k8s.io/component-helpers/scheduling/schedulingv1/workloadbuilder in the kubernetes/component-helpers repository. Even better, the library and types require no feature gates at all.

Inside its code, a controller describes a workload as a tree of WorkloadItem nodes: a node with children automatically becomes a CompositePodGroupTemplate, and a leaf becomes a PodGroupTemplate. From there, workloadbuilder takes over the boilerplate. Validate() checks the config and returns errors pointing to exact field paths in the controller's own API. BuildWorkload() constructs the Workload, while NewPodGroup() and NewCompositePodGroup() stamp out runtime groups. For split setups where a parent controller owns the shared Workload and a child controller only creates its PodGroup, there is NewBuilderFromExistingWorkload.

Validation also follows a strict deny-by-default model. Controllers must explicitly list supported modes in AllowedPolicies and AllowedDisruptionModes. If future Kubernetes releases introduce new scheduling policies, an older controller won't silently accept them with unpredictable results—it will reject them until developers add explicit support.

The built-in Job controller is the first adopter of these building blocks (KEP-5547, behind the alpha WorkloadWithJob flag). Previously, the controller tried to guess user intent from indirect signals like the Job's shape. In v1.37, batch/v1 Job gains a direct .spec.scheduling field assembled from those same four blocks.

# Native Job with an explicit .spec.scheduling block (Alpha, WorkloadWithJob)
apiVersion: batch/v1
kind: Job
metadata:
  name: distributed-training-job
spec:
  parallelism: 8
  completions: 8
  scheduling:
    schedulingPolicy:
      # Empty gang pulls minCount from parallelism (8 here)
      gang: {}
    schedulingConstraints:
      topology:
        - key: topology.kubernetes.io/zone
    disruptionMode:
      all: {}
  template:
    spec:
      containers:
        - name: trainer
          image: example/trainer:latest

If you omit .spec.scheduling or leave out schedulingPolicy, the Job behaves as before (basic), avoiding surprises for existing manifests. When the block is present, the controller compiles it into Workload and PodGroup, sets the Job as their owner, and populates .spec.schedulingGroup.podGroupName on every created pod so the scheduler treats them as one team.

What Can Be Changed in a Job After Creation

Once a Job is created, the entire .spec.scheduling block is frozen: you can't switch from basic to gang or change topology and disruption mode on the fly. The only exception is schedulingPolicy.gang.minCount, which you can edit on a running Job to adjust the minimum group size dynamically.

Shared DRA Resources for Groups and Preventing a Claim Flood

Modern AI jobs rarely run on CPU and RAM alone. They need GPUs, network accelerators, or specialized devices allocated via Dynamic Resource Allocation (DRA). Instead of old primitive counters, DRA works with ResourceClaim and ResourceClaimTemplate objects.

Kubernetes v1.36 introduced an alpha feature called DRAWorkloadResourceClaims (KEP-5729) to reserve one ResourceClaim from a template for an entire PodGroup and share it across all pods in the group. In v1.37, this feature reached Beta.

Modular 3D render of a hardware accelerator pool with a single ResourceClaim shared across a group of pods

# Shared DRA claim at the PodGroup level
apiVersion: scheduling.k8s.io/v1beta1
kind: PodGroup
metadata:
  name: training-job-workers-pg
spec:
  resourceClaims:
    - name: pg-claim
      resourceClaimTemplateName: my-claim-template
---
# A pod in the group references the same shared resource
apiVersion: v1
kind: Pod
metadata:
  name: topology-aware-workers-pg-pod
spec:
  schedulingGroup:
    podGroupName: training-job-workers-pg
  resourceClaims:
    - name: pg-claim
      resourceClaimTemplateName: my-claim-template

The API format itself didn't change in this release, but the developers fixed a nasty footgun from v1.36. Imagine deploying manifests where a pod references a ResourceClaimTemplate matching its PodGroup claim, on a cluster where DRAWorkloadResourceClaims happens to be disabled (for instance, forgotten after an upgrade or on a staging cluster).

In v1.36, Kubernetes silently created a separate ResourceClaim for every pod in the group. Launch 64 workers expecting one shared pool, and you suddenly got 64 individual claims that burned through the entire cluster's hardware quota. In v1.37, that behavior is fixed: if DRAWorkloadResourceClaims is off and a pod's claim matches the group's claim, Kubernetes creates zero ResourceClaim objects. No more silent claim floods.

Which Flags to Enable in Your Cluster and What's Coming in v1.38

Here is the main practical detail that trips people up: every Workload-Aware Scheduling feature in Kubernetes v1.37 is disabled by default, both alpha and beta. Simply upgrading to 1.37 and applying the YAML above won't work. You have to turn on the feature gates manually across control plane components (and on kubelet for DRA).

Feature GateStatusWhere to EnableCapabilities & Notes
GenericWorkloadBetakube-apiserver, kube-controller-manager, kube-schedulerWorkload/PodGroup (v1beta1), gang scheduling, and merged WAP
DRAWorkloadResourceClaimsBetakube-apiserver, kube-controller-manager, kube-scheduler, kubeletShared DRA ResourceClaim per PodGroup
TopologyAwareWorkloadSchedulingAlphakube-apiserver, kube-schedulerSingle-level and multi-level TAS
CompositePodGroupAlphakube-apiserver, kube-controller-manager, kube-schedulerRequires scheduling.k8s.io/v1alpha3; also needs TopologyAwareWorkloadScheduling on kube-controller-manager
WorkloadWithJobAlphakube-apiserver, kube-controller-managerExplicit .spec.scheduling field in batch/v1 Job
PodGroupPreemptionPolicyAlphakube-apiserver, kube-schedulerExplicit preemptionPolicy field in PodGroup
Two Traps When Enabling in a Test Cluster

First, if you already tested WAS on v1.36, migrate your manifests from the removed v1alpha2 to v1beta1 (or v1alpha3 for CompositePodGroup) and update old disruptionMode values (PodGroup -> all, Pod -> single). Second, when enabling CompositePodGroup on kube-controller-manager, don't forget to enable TopologyAwareWorkloadScheduling and the scheduling.k8s.io/v1alpha3 API version there as well—without that combination, the hierarchy won't start.

Looking ahead to the Kubernetes v1.38 cycle, WG Workload-Aware Scheduling already has a clear roadmap:

  • graduate core Workload and PodGroup to stable GA;
  • promote multi-level TAS, CompositePodGroup, and controller integration building blocks to Beta;
  • expand adoption across external orchestrators, starting with JobSet;
  • align native WAS with the Kueue (kueue.x-k8s.io) queuing and quota system: first ensuring full compatibility so Kueue understands WAS objects, and later using Kubernetes' built-in mechanism as Kueue's underlying engine for gang and topology-aware scheduling.

It's worth trying these features now on a separate test cluster—especially since workloadbuilder works right away without flags. The authors collect bug reports and real-world scenarios in #wg-workload-aware-scheduling on Kubernetes Slack, at open WG WAS / SIG Scheduling meetings, and in the main Kubernetes repository issues.

Want a deep diveVotes help us choose what to break down in detail. This material has 0 votes.
Sources · 8