Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.

Commit 4227137

Browse files
committed
feat(supervisor): add Kubernetes worker pod priority class support
Add KUBERNETES_POD_PRIORITY_CLASS_NAME environment variable to allow configuring a priority class for task run pods in Kubernetes environments. This addresses pod preemption issues in resource-constrained clusters, particularly in GKE Autopilot where low-priority pods can be preempted by system pods during scale-up operations. Fixes: Pod preemption causing SIGTERM failures during cluster scale-up Related: GKE Autopilot resource contention
1 parent 279102c commit 4227137

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

apps/supervisor/src/env.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ const Env = z.object({
111111
KUBERNETES_MEMORY_OVERHEAD_GB: z.coerce.number().min(0).optional(), // Optional memory overhead to add to the limit in GB
112112
KUBERNETES_SCHEDULER_NAME: z.string().optional(), // Custom scheduler name for pods
113113
KUBERNETES_LARGE_MACHINE_POOL_LABEL: z.string().optional(), // if set, large-* presets affinity for machinepool=<value>
114+
KUBERNETES_POD_PRIORITY_CLASS_NAME: z.string().optional(), // Priority class name for task run pods
114115

115116
// Placement tags settings
116117
PLACEMENT_TAGS_ENABLED: BoolEnv.default(false),

apps/supervisor/src/workloadManager/kubernetes.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,11 @@ export class KubernetesWorkloadManager implements WorkloadManager {
320320
},
321321
}
322322
: {}),
323+
...(env.KUBERNETES_POD_PRIORITY_CLASS_NAME
324+
? {
325+
priorityClassName: env.KUBERNETES_POD_PRIORITY_CLASS_NAME,
326+
}
327+
: {}),
323328
};
324329
}
325330

0 commit comments

Comments
 (0)