Skip to content

Commit cffaa05

Browse files
authored
feat(supervisor): optional priority class for run pods (#4671)
Adds an optional priority class for run pods. ``` KUBERNETES_RUN_POD_PRIORITY_CLASS_NAME ``` When set, the value is applied as `priorityClassName` on the run pod spec. When unset, pods are created exactly as before. Off by default, and inert unless set. It sits beside the existing `KUBERNETES_SCHEDULER_NAME` option and follows the same conditional shape: ```ts ...(env.KUBERNETES_RUN_POD_PRIORITY_CLASS_NAME ? { priorityClassName: env.KUBERNETES_RUN_POD_PRIORITY_CLASS_NAME } : {}), ``` ## Verification `typecheck --filter supervisor`, `format` and `lint` clean. No changeset or `.server-changes/` note: off by default, no user-visible behaviour change.
1 parent 12ec466 commit cffaa05

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
@@ -187,6 +187,7 @@ export const Env = z
187187
KUBERNETES_STRIP_IMAGE_DIGEST: BoolEnv.default(false),
188188
KUBERNETES_IMAGE_REGISTRY_REWRITE_FROM: z.string().optional(),
189189
KUBERNETES_IMAGE_REGISTRY_REWRITE_TO: z.string().optional(),
190+
KUBERNETES_RUN_POD_PRIORITY_CLASS_NAME: z.string().optional(),
190191
KUBERNETES_CPU_REQUEST_MIN_CORES: z.coerce.number().min(0).default(0),
191192
KUBERNETES_CPU_REQUEST_RATIO: z.coerce.number().min(0).max(1).default(0.75), // Ratio of CPU limit, so 0.75 = 75% of CPU limit
192193
KUBERNETES_MEMORY_REQUEST_MIN_GB: z.coerce.number().min(0).default(0),

apps/supervisor/src/workloadManager/kubernetes.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,11 @@ export class KubernetesWorkloadManager implements WorkloadManager {
371371
schedulerName: env.KUBERNETES_SCHEDULER_NAME,
372372
}
373373
: {}),
374+
...(env.KUBERNETES_RUN_POD_PRIORITY_CLASS_NAME
375+
? {
376+
priorityClassName: env.KUBERNETES_RUN_POD_PRIORITY_CLASS_NAME,
377+
}
378+
: {}),
374379
...nodetypeNodeSelector(env.KUBERNETES_WORKER_NODETYPE_LABEL),
375380
...(env.KUBERNETES_POD_DNS_NDOTS_OVERRIDE_ENABLED
376381
? {

0 commit comments

Comments
 (0)