Repository navigation
Description
Update 2026-11-26 (infra move): Most of the other workloads moved to dan-petty/homelab.
This item keeps the k8s/devops/ work of the design below: the three PriorityClass objects, the class on the roadmap Service, the Job templates and rag-ingest, and the admission policy. The class names on the platform and stack workloads are the homelab follow-up, which merges after this item. Where the design names the infra repo or #5120 for those workloads, read dan-petty/homelab.
Follow-up: dan-petty/homelab#291.
Problem or Motivation
Today a pending service pod cannot preempt a runner Job after a node loss. The headroom absorbs a node loss today (memory use 18 to 30 %, CPU requests 13 to 43 %). But the runner CPU rows of #4719 (8-CPU Jobs) and #3064 (several implement Jobs at once) raise the batch requests. This item is rank 23 of the cluster integration plan #4989.
Proposed Solution & Architectural Design
- Add three PriorityClasses in git:
- platform: cloudflared, Traefik, Argo CD, and the CNPG and cert-manager webhooks;
- service: roadmap-service, llm-gateway, the Postgres clusters and Valkey;
- batch: runner Jobs and rag-ingest, below the default, with
preemptionPolicy: Never.
- The CEL policy
roadmap-service-jobsmust admit the batch class. - The runner template sets
priorityClassName.
Target Subsystem
Kubernetes & Minikube Automation (k8s/).
Existing Tool Considered
Kubernetes PriorityClass. Nothing is built.
Acceptance Criteria
- Each workload above has its priority class in git.
- The CEL policy admits a runner Job with the batch class and refuses one with the service class.
Dependencies
#4719 (runner CPU rows) and #3064 (several implement Jobs at once).
Source: #4989
Alternatives check of 2026-11-27: in-use.
The repository already uses this tool.
Tool: kubernetes/kubernetes (https://github.com/kubernetes/kubernetes), Apache-2.0, last activity 2026-11-27, maintained.
Reason: Searches found no separate priority or preemption tool; the need is met by the built-in Kubernetes PriorityClass API, which the issue already names as the tool in use. The work is manifests plus policy changes, not new tooling.
Covers:
- PriorityClass objects with ordered values
- preemptionPolicy Never keeps batch Jobs from displacing pods
- priorityClassName on pod templates and WorkflowTemplate pods
- Preemption of lower-priority batch pods by service pods
Lacks:
- Admission policy rule admitting only the batch class
- Manifests for platform, service and batch classes in the repo
- Gate check that a wrong class fails
Proposed design
Problem statement
The CEL policy roadmap-service-jobs refuses a priorityClassName on a Job that the roadmap Service makes. A pending service pod cannot preempt a runner Job after a node loss. This change adds three PriorityClass objects under k8s/devops/, admits the batch class, sets the class on the governed Job templates, Deployment roadmap-service and WorkflowTemplate rag-ingest, and adds the gate checks for the order, the Never policy and a wrong class. The classes of the platform and stack workloads are the homelab follow-up dan-petty/homelab#291.
Acceptance criteria
Requirement: Three priority classes in the product base
The repository SHALL hold PriorityClass manifests platform, service and batch under k8s/devops/, with values ordered platform > service > 0 > batch.
Scenario: The k8s row accepts the class order
- WHEN
uv run devops ci --check --only k8sruns the k8s manifest check. - THEN The command exits 0.
Requirement: Batch never preempts
The batch PriorityClass MUST set preemptionPolicy: Never, so a runner Job never displaces another pod.
Scenario: The k8s row accepts the batch preemption policy
- WHEN
uv run devops ci --check --only k8sruns the k8s manifest check. - THEN The command exits 0.
Requirement: The policy admits the batch class
The CEL policy roadmap-service-jobs SHALL accept a Job whose pod template sets priorityClassName: batch.
Scenario: A runner Job with the batch class passes the admission check
- WHEN
uv run devops ci --check --only k8sruns the admission-policy check against the Job that CronJobdevops-cli-runnermakes. - THEN The command exits 0.
Requirement: The policy refuses every other class
The CEL policy roadmap-service-jobs MUST require priorityClassName: batch on each governed Job and refuse a Job that sets another class.
Scenario: A runner Job with the service class fails the admission check
- WHEN
uv run devops ci --check --only k8sruns the admission-policy check against a Job whose pod template setspriorityClassName: service. - THEN The command exits 0 and the check reports that the policy refused the Job.
Requirement: The governed Job templates set the batch class
Each governed CronJob in k8s/devops/ (devops-cli-runner, roadmap-stage and devops-cli-planner-run) MUST set priorityClassName: batch on its Job pod template.
Scenario: The k8s row accepts the three governed templates
- WHEN
uv run devops ci --check --only k8sruns the admission-policy check against the Jobs of the three governed CronJobs. - THEN The command exits 0.
Requirement: The roadmap Service takes the service class
Deployment roadmap-service under k8s/devops/ SHALL set priorityClassName: service on its pod template.
Scenario: The k8s row accepts the service class on the deployment
- WHEN
uv run devops ci --check --only k8sruns the k8s manifest check. - THEN The command exits 0.
Requirement: The rag-ingest Workflow takes the batch class
WorkflowTemplate rag-ingest in k8s/devops/ SHALL set the batch priority class on the pods that it makes.
Scenario: The k8s row accepts the batch class on the workflow template
- WHEN
uv run devops ci --check --only k8sruns the k8s manifest check. - THEN The command exits 0.
Existing Tool Considered
The alternatives check of 2026-11-27 records the verdict in-use for kubernetes/kubernetes (Apache-2.0, maintained), the built-in PriorityClass API. The check block in the issue body lists what the tool covers and lacks. This change adds what the block lacks: the three PriorityClass manifests under k8s/devops/, the batch admission in the CEL policy, priorityClassName: batch on the three governed Job templates and on WorkflowTemplate rag-ingest, priorityClassName: service on Deployment roadmap-service, and the gate check for a wrong class.
Key questions
- Does the CEL policy
roadmap-service-jobsadmit apriorityClassNameon a Job today?: No. The policy admits nopriorityClassNameon a governed Job. The change must add thebatchclass to its rule. [sources: k8s/devops/roadmap-service/admissionpolicy.yaml, docs/CLUSTER.md] - What runs the policy expressions before a merge?: The gate check
tests/gate/k8s_checks/job_admission_policy.pyruns them against the Jobs that the CronJobs ofk8s/devops/make. Thek8srow ofdevops ciruns this check. [sources: tests/gate/k8s_checks/job_admission_policy.py, docs/CLUSTER.md] - Which Jobs does the policy
roadmap-service-jobsgovern, and which CronJobs ofk8s/devops/make them?: The policy governs the Jobs of CronJobdevops-cli-runner, CronJobroadmap-stageand CronJobdevops-cli-planner-run. Each of their pod templates must setpriorityClassName: batch. [sources: k8s/devops/roadmap-service/admissionpolicy.yaml, k8s/devops/cronjob-runner.yaml, k8s/devops/cronjob-stage.yaml, k8s/devops/roadmap-service/cronjob-planner-run.yaml] - Which names and values do the three priority classes use?: Use
platformat 1000000,serviceat 100000, andbatchat -10. SetpreemptionPolicy: Neveronbatch. Values above 1000000000 are reserved for Kubernetes system components. (best practice) [sources: docs/guidelines/kubernetes.md]- Chosen: platform 1000000, service 100000, batch -10. The order gives platform pods the first claim, service pods the second, and batch below the default priority 0.
- Rejected: Three positive values with batch at 0. At 0 a runner Job is not below the default priority.
- Rejected: Reuse system-cluster-critical and system-node-critical. Those values are reserved for Kubernetes system components and preempt every workload.
- Must the policy require the
batchclass on a governed Job, or only permit it?: RequirepriorityClassName: batchon each Job that the policy governs. A Job with no class keeps the default priority 0, abovebatch. (best practice) [sources: k8s/devops/roadmap-service/admissionpolicy.yaml, tests/gate/k8s_checks/job_admission_policy.py]- Chosen: Require batch on each governed Job template. Every roadmap Job then carries one class. The gate check fails when a template loses the field.
- Rejected: Permit batch and permit no class. A Job that loses the field keeps priority 0. It can displace a batch Job of another repository.
- Rejected: Permit any class. A Job with the service or platform class can displace a service pod.
- Where do the three
PriorityClassmanifests live?: Underk8s/devops/in this repository, beside the admission policy that must admit thebatchclass. (best practice) [sources: docs/CLUSTER.md, k8s/README.md]- Chosen:
k8s/devops/in this repository. The policy that the classes must satisfy ships from this repository. The delivery is one pull request here. - Rejected: The environment tree of dan-petty/homelab. The environment tree holds no admission policy of this Service. A change there would need a second pull request in a second repository.
- Chosen:
- Should the classes of the platform and stack workloads ship in this item or in the homelab follow-up?: Ship them in the homelab follow-up
dan-petty/homelab#291. This repository holds only the product basek8s/devops/. (best practice) [sources: docs/CLUSTER.md, CONTEXT.md]- Chosen: Defer to
dan-petty/homelab#291. The environment tree is not in this repository, and the body names the homelab follow-up. - Rejected: Include every workload now. The change would touch two repositories.
- Chosen: Defer to
- Which check proves the class order, the
Neverpolicy and the wrong class?: Thek8srow ofdevops ciruns the gate checks oftests/gate/k8s_checks/. The change extendsjob_admission_policy.pywith a case for a Job that sets a class other thanbatch, and adds a check of the class order and ofpreemptionPolicy: Never. (best practice) [sources: tests/gate/k8s_checks/job_admission_policy.py, docs/CLUSTER.md]- Chosen: Extend the gate checks of
tests/gate/k8s_checks/. Thek8srow already runs these checks, so one row proves the manifests and the policy. - Rejected: A live check with
kubectlafter the apply. A live check needs a cluster. It proves nothing before the merge.
- Chosen: Extend the gate checks of
- Which documents change with the policy?:
docs/CLUSTER.mdand theroadmap-implement-runnerspec delta of the change. Both state the rule that the change replaces. (best practice) [sources: docs/CLUSTER.md, openspec/specs/roadmap-implement-runner/spec.md]- Chosen:
docs/CLUSTER.mdand the spec delta. Both state the rule that the change replaces. The merged tree keeps no stale rule. - Rejected: The spec delta only.
docs/CLUSTER.mdkeeps the old rule and misleads the next reader.
- Chosen:
Fit
Fits in one pull request.
Suspected block
None.
Activity
dan-petty commentedon Nov 12, 2026
Both configure runner Job settings in k8s, but #3193 sizes CPU and memory while this adds priority classes for preemption.devops-cli-service commentedon Nov 16, 2026
Refine cannot set this item to Ready at 7e1f8a8 while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.
The next refine round also looks at the item again when a commit on the default branch changes one of these files:
k8s/devops/roadmap-service/admissionpolicy.yaml.devops-cli-service commentedon Nov 16, 2026
Refine cannot set this item to Ready at 9cc974b while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.
devops-cli-service commentedon Nov 21, 2026
The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.
Searches (3)
Tools considered:
Searches run:
Sources:
devops-cli-service commentedon Nov 26, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.
devops-cli-service commentedon Dec 1, 2026
Next step: the stage job writes the plan of the item. See the section Proposed design of the body.