Repository navigation
Description
Problem or Motivation
PR #7410 (#7364) adds the policy argo-workflow-egress in namespace devops. It lets each pod with the label workflows.argoproj.io/workflow reach the API server on TCP 6443. The Argo Workflows controller sets this label on each Workflow pod.
The ValidatingAdmissionPolicy roadmap-service-jobs checks each Job that the roadmap Service creates. It does not refuse this label on the pod template of a Job. A Job of the Service that carries the label would get the same egress rule as a Workflow pod. The k8s gate row of #7410 checks only the pod templates of the CronJobs devops-cli, devops-cli-runner and roadmap-stage, not the Jobs that the Service makes at run time.
The Job pod mounts no token, so this is defense in depth, not an open path.
Proposed Solution & Architectural Design
Add one validation to roadmap-service-jobs: refuse a Job whose pod template has the label key workflows.argoproj.io/workflow. Prove it with the existing admission policy tests of the k8s check.
Acceptance Criteria
-
roadmap-service-jobsrefuses a Job whose pod template carries the label keyworkflows.argoproj.io/workflow. -
uv run devops ci --check --only k8sexits zero.
Dependencies
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: The built-in ValidatingAdmissionPolicy, already run as roadmap-service-jobs, expresses this refusal in one CEL rule on the Job pod template; Kyverno would only duplicate it, so no new tool is needed.
Covers:
- CEL validations deny a Job whose pod template carries a label key
- Runs at admission, so run-time Service Jobs are checked, not only CronJob templates
- The repository already deploys the policy, so the change is one more rule
Lacks:
- No built-in test runner for policy rules; the project keeps its own
- Refusals surface only as events and audit annotations, with no dashboard
- No re-check of Jobs created before the rule; admission only sees new ones
Proposed design
Problem statement
The roadmap-service-jobs ValidatingAdmissionPolicy admits a Job whose pod template carries the label key workflows.argoproj.io/workflow. Such a Job would get the Workflow pod egress rule of the argo-workflow-egress policy. The change adds one CEL rule that denies the label at admission, so run-time Service Jobs are checked. The Job pod mounts no token, so this is defense in depth.
Acceptance criteria
Requirement: Deny the Workflow label
The roadmap-service-jobs ValidatingAdmissionPolicy SHALL deny a Job whose pod template carries the label key workflows.argoproj.io/workflow.
Scenario: A Service Job with the Workflow label
- WHEN
uv run devops ci --check --only k8sruns the admission policy tests with a Job that has the label keyworkflows.argoproj.io/workflowin its pod template - THEN the test reports the denial of that Job by
roadmap-service-jobs, and the command exits zero
Requirement: Admit a Service Job without the label
The roadmap-service-jobs ValidatingAdmissionPolicy MUST still admit a Job whose pod template has no workflows.argoproj.io/workflow label key.
Scenario: A Service Job with no Workflow label
- WHEN
uv run devops ci --check --only k8sruns the admission policy tests with the existing allowed Service Job - THEN the test reports the admission of that Job, and the command exits zero
Existing Tool Considered
The alternatives block of the issue records the verdict in-use for kubernetes/kubernetes (Apache-2.0, maintained). The built-in ValidatingAdmissionPolicy, already deployed as roadmap-service-jobs, covers the refusal in one CEL rule on the Job pod template. The block lists what the tool covers and lacks; read it in the issue body. This proposal adds the rule and proves it with the project's own policy test runner, which the block names as a lack of the tool. The change writes no new tool code.
Key questions
- How does the policy refuse the Workflow label on a Job pod template?: Add one CEL validation rule to the existing
roadmap-service-jobspolicy. The rule denies a Job when the labels of its pod template hold the keyworkflows.argoproj.io/workflow. Admission then checks each Job that the Service creates at run time, so no CronJob template list changes. The alternatives block records the verdictin-usefor kubernetes/kubernetes. (best practice) [sources: AGENTS.md, k8s/README.md]- Chosen: One CEL rule on the existing policy. The policy already matches the Jobs of the Service, so one more rule covers run-time Jobs with no new component.
- Rejected: A second ValidatingAdmissionPolicy. It repeats the Job match of the existing policy and splits one refusal across two objects.
- Rejected: A Kyverno policy. The alternatives block states that Kyverno would only duplicate the built-in policy, and it adds a new engine.
Fit
Fits in one pull request.
Suspected block
None.
Activity
dan-petty commentedon Nov 27, 2026
Both add a label refusal to the roadmap-service-jobs admission policy, but #7402 targets app.kubernetes.io/component: project-review while this targets workflows.argoproj.io/workflow.devops-cli-service commentedon Nov 27, 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 (10)
Tools considered:
Searches run:
Sources:
devops-cli-service commentedon Nov 28, 2026
Next step: the stage job writes the plan of the item. See the section Proposed design of the body.