Skip to content

feat(k8s): let roadmap-service create Argo Workflows #6592

Open

Description

@dan-petty

Update 2026-11-26 (infra move): k8s/argo-workflows/ is in dan-petty/homelab now.

The Role, the admission policy and ConfigMap roadmap-limits of this item stay in k8s/devops/. The controller values that must manage namespace devops first are in homelab (#5289, #4566).


Problem

The refine split of #4566 on 2026-11-14 gives this part its own item. Today the Service cannot create Argo Workflows in devops. Its Role has no rule for workflows, and no admission policy limits what it submits.

The owner live proof of 2026-11-13 on #4566 needs the Service to submit Workflows as the App. So the proof is in this item, not in #4566.

Scope

Acceptance criteria

Each as a live check, not a live pytest:

  • A Workflow with an inline spec.templates from ServiceAccount roadmap-service is refused.
  • A change of roadmap-limits applies to the next Workflow.
  • Live proof (owner, 2026-11-13): after the merge, two Workflows of one item run as the App, and the second waits for the item mutex item-<repo>-<n>. A comment on this issue gives the Workflow names and the times.

Dependencies

Source

Source: #4517

Alternatives check of 2026-11-21: in-use.
The repository already uses this tool.
Tool: argoproj/argo-workflows (https://github.com/argoproj/argo-workflows), Apache-2.0, last activity 2026-11-21, maintained.
Reason: Argo Workflows' own controller controls cover part of the need: secure template referencing refuses inline templates and semaphore ConfigMaps hold the limits, but ADR 0021 rejected secure mode, and the Role verbs and per-ServiceAccount rule stay in-repo.

Covers:

  • Controller setting can require a workflowTemplateRef instead of inline templates
  • Semaphore and mutex ConfigMaps hold the per-lane concurrency limits
  • WorkflowTemplate keeps the pod spec out of the submitter's request

Lacks:

  • No per-ServiceAccount admission; secure mode applies to every submitter
  • No Role verbs; create, get, list and delete are Kubernetes RBAC
  • Secure mode fails running Workflows at each release, so ADR 0021 rejected it
  • No check on the template name prefix roadmap-*

Proposed design

Problem statement

The roadmap Service cannot create Argo Workflows in devops: its Role has no rule for workflows.argoproj.io, and no admission policy limits what it submits. This item gives the Role create, get, list and delete, adds a per-ServiceAccount ValidatingAdmissionPolicy that admits only a roadmap-* workflowTemplateRef with arguments, and adds the roadmap-limits semaphore ConfigMap. The owner live proof of 2026-11-13 on #4566 needs the Service to submit Workflows as the App, so this item carries that proof.

Acceptance criteria

Requirement: Workflow role verbs

The roadmap-service Role SHALL grant the verbs create, get, list and delete on workflows.argoproj.io in namespace devops.

Scenario: ServiceAccount can use the workflow verbs

  • WHEN Run for verb in create get list delete; do kubectl auth can-i "$verb" workflows.argoproj.io --as=system:serviceaccount:devops:roadmap-service -n devops; done.
  • THEN The command prints yes four times.

Requirement: Only a template reference in the spec

The ValidatingAdmissionPolicy SHALL refuse a Workflow from ServiceAccount roadmap-service whose spec holds any key other than workflowTemplateRef and arguments.

Scenario: Inline template denied

  • WHEN Run kubectl create --dry-run=server --as=system:serviceaccount:devops:roadmap-service -n devops -f tests/fixtures/workflows/inline-template.yaml.
  • THEN The command exits non-zero and prints a denial that names roadmap-service-workflows.

Requirement: Roadmap template reference admitted

The ValidatingAdmissionPolicy SHALL admit a Workflow from ServiceAccount roadmap-service whose spec holds only workflowTemplateRef with a name that starts with roadmap- and optional arguments.

Scenario: Allowed template reference

  • WHEN Run kubectl create --dry-run=server --as=system:serviceaccount:devops:roadmap-service -n devops -f tests/fixtures/workflows/roadmap-template-ref.yaml.
  • THEN The command exits 0 and prints workflow.argoproj.io/roadmap-template-ref created (server dry run).

Requirement: Non-roadmap template prefix refused

The ValidatingAdmissionPolicy SHALL refuse a Workflow from ServiceAccount roadmap-service whose workflowTemplateRef name does not start with roadmap-.

Scenario: Wrong template prefix denied

  • WHEN Run kubectl create --dry-run=server --as=system:serviceaccount:devops:roadmap-service -n devops -f tests/fixtures/workflows/other-template-ref.yaml.
  • THEN The command exits non-zero and prints a denial that names roadmap-service-workflows.

Requirement: Roadmap limits values

The ConfigMap roadmap-limits SHALL hold the semaphores agent with value 2, research with value 1, triage with value 1 and steward with value 1.

Scenario: Semaphore values

  • WHEN Run kubectl get configmap roadmap-limits -n devops -o json | jq -c '.data'.
  • THEN The command prints {"agent":"2","research":"1","steward":"1","triage":"1"}.

Requirement: Semaphore change applies to the next Workflow

A change to the agent value in roadmap-limits SHALL apply to the next Workflow that uses the agent semaphore.

Scenario: Agent semaphore lowered to one

  • WHEN Set agent to 1 in roadmap-limits, create two Workflows as system:serviceaccount:devops:roadmap-service from the roadmap-* template that uses the agent semaphore, each with the label roadmap.devops-cli/item=<n>, and run kubectl get workflows.argoproj.io -n devops -l roadmap.devops-cli/item=<n> -o jsonpath='{range .items[*]}{.status.phase}{"\n"}{end}' | sort | uniq -c.
  • THEN The command prints one Pending line and one Running line.

Requirement: Owner live proof of two Workflows

The Service SHALL submit two Workflows of one item as the App, and the second Workflow SHALL wait for the item mutex item-<owner>.<name>-<n>.

Scenario: Two Workflows of one item

  • WHEN After the merge, the owner runs one item and comments the two Workflow names and times on this issue.
  • THEN The comment shows the two Workflows run as the App, and the second waits for item-<owner>.<name>-<n>.

Existing Tool Considered

Argo Workflows (https://github.com/argoproj/argo-workflows), Apache-2.0, last activity 2026-11-21, is in use; the alternatives block of the issue body (2026-11-21) gives the verdict in-use and its Lacks: list. This item keeps the controller and adds the Role verbs, the per-ServiceAccount ValidatingAdmissionPolicy and the roadmap-limits ConfigMap.

Key questions

  • Which admission mechanism should enforce the Workflow spec shape?: Use a Kubernetes ValidatingAdmissionPolicy with standard CEL. It runs in the API server and needs no extra controller or webhook, and the repository already uses this mechanism for the Service's Jobs. Kyverno adds a controller and CRDs, and Argo Workflows secure mode is rejected by ADR 0021. (best practice) [sources: openspec/changes/archive/2026-10-30-2696-job-admission-policy/design.md:5, docs/SERVICE_PATTERNS.md:75, docs/guidelines/production-readiness.md:128, k8s/devops/roadmap-service/admissionpolicy.yaml:28]
    • Chosen: ValidatingAdmissionPolicy. It is built into the API server, needs no extra controller, and is the mechanism the Job policy already uses.
    • Rejected: Kyverno policy. It adds a controller and CRDs for one policy.
    • Rejected: Argo Workflows secure template referencing. ADR 0021 rejected secure mode because it fails running Workflows at each release.
  • How should the policy limit the Workflow spec to workflowTemplateRef and arguments?: Add ValidatingAdmissionPolicy roadmap-service-workflows, bound by a binding of the same name to system:serviceaccount:devops:roadmap-service, and allow-list the top-level spec keys with standard CEL: has(object.spec.workflowTemplateRef) && has(object.spec.workflowTemplateRef.name) && object.spec.workflowTemplateRef.name.startsWith('roadmap-') && size(object.spec) == 1 + (has(object.spec.arguments) ? 1 : 0). The matchConditions keep another submitter out of the evaluation, and the expression uses only has, size, startsWith and operators, which the repository's offline CEL gate check can run. (best practice) [sources: docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md:70, docs/SERVICE_PATTERNS.md:75, openspec/changes/archive/2026-10-30-2696-job-admission-policy/design.md:19, k8s/devops/roadmap-service/admissionpolicy.yaml:45]
    • Chosen: Allow-list the top-level spec keys. It enforces the stated rule exactly, including a future field that Argo adds, with only standard CEL.
    • Rejected: Deny only spec.templates. It leaves other spec keys open, such as entrypoint, volumes or serviceAccountName, and does not enforce the stated rule.
    • Rejected: Rely on Argo templateReferencing: Strict alone. It applies to every submitter and checks no roadmap-* prefix; ADR 0021 keeps a per-ServiceAccount policy.
  • Which ServiceAccount and namespace should the policy bind to?: Bind the policy to system:serviceaccount:devops:roadmap-service in namespace devops. The policy then limits only the roadmap Service and leaves other submitters alone. (best practice) [sources: k8s/devops/roadmap-service/role.yaml:68, k8s/devops/roadmap-service/admissionpolicy.yaml:45, docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md:70]
    • Chosen: Bind to the roadmap-service ServiceAccount. It applies the rule to the Service alone and follows least privilege.
    • Rejected: Bind to every ServiceAccount in devops. It would change other submitters that the issue does not cover.
  • How should the Service enforce the per-lane concurrency limits?: Use the Argo Workflows semaphore ConfigMap roadmap-limits in namespace devops, with one key per lane (agent, research, triage, steward), and reference it from each WorkflowTemplate's synchronization.semaphore.configMapKeyRef. Argo reads the key when a Workflow takes the lock, so a ConfigMap edit applies to the next Workflow and a person changes a limit with one edit. The body's owner decision of 2026-11-13 sets the values; ADR 0021 section 5 records the earlier limits and the ConfigMap mechanism. (best practice) [sources: docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md:67, docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md:97, docs/SERVICE_PATTERNS.md:52, docs/SERVICE_PATTERNS.md:178]
    • Chosen: Argo semaphore ConfigMap. Argo reads the ConfigMap for each Workflow and applies the lane limit with no code of ours.
    • Rejected: Custom controller or queue. It builds what Argo already has and adds a controller to keep.
    • Rejected: Kubernetes ResourceQuota. It limits resources, not concurrent units of one lane, and cannot count Workflows by lane.
  • What is the name of the item mutex that the second Workflow waits on?: The mutex name is <row>-<owner>.<name>[-<n>], casefolded, so the item mutex is item-<owner>.<name>-<n>, not the issue's shorthand item-<repo>-<n>. [sources: docs/adr/0022-one-repository-reference-names-the-objects-labels-and-keys-of-each-repository.md:91, docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md:63]
  • Which label selects the Workflows of one item?: The label roadmap.devops-cli/item holds the issue number, and roadmap.devops-cli/repo holds the repository label value; the proposal's roadmap/item is not the project's label. [sources: docs/adr/0022-one-repository-reference-names-the-objects-labels-and-keys-of-each-repository.md:77, docs/adr/0022-one-repository-reference-names-the-objects-labels-and-keys-of-each-repository.md:78, docs/adr/0022-one-repository-reference-names-the-objects-labels-and-keys-of-each-repository.md:79]
  • Does the Argo Workflows controller run Workflows in devops today?: No. k8s/argo-workflows/values.yaml of dan-petty/homelab sets singleNamespace: true, and k8s/README.md says the controller watches only argo-workflows. ADR 0021 records that the engine step (feat(k8s): let Argo Workflows run roadmap pods in devops #4566) runs it with --namespaced --managed-namespace devops and templateReferencing: Strict; this item waits on feat(k8s): let Argo Workflows run roadmap pods in devops #4566 for that. [sources: k8s/argo-workflows/values.yaml:25, k8s/README.md:863, docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md:314, docs/adr/0008-argo-workflows-run-the-roadmap-jobs-after-a-measured-go.md:50]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#4566

Watched files

A commit on the default branch that changes one of these files starts the next refine round.

  • k8s/argo-workflows/values.yaml
  • src/devops_cli/roadmap/job_launcher.py

Activity

  1. added
    type/feature
    scope/k8s
    source/agent
    status/new
    value/medium
    effort/medium
    on Nov 21, 2026
  2. dan-petty commented on Nov 21, 2026

    @dan-petty
    OwnerAuthor
    • Related: feat(k8s): show devops Workflows in the Argo UI #4570, which asks for a different change. Both change RBAC for Argo Workflows in namespace devops; 4570 gives read-only list access to the UI, and the candidate gives create and delete access to roadmap-service.
  3. added
    priority/p2-medium
    on Nov 21, 2026
  4. devops-cli-service commented on Nov 21, 2026

    @devops-cli-service
    Contributor

    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:

    • Kubernetes ValidatingAdmissionPolicy restrict Argo Workflow inline spec.templates, results: 5
    • Argo Workflows templateReferencing Secure restrict workflowTemplateRef only, results: 5
    • argo workflows semaphore ConfigMap synchronization example, results: 5
    • argoproj argo-workflows workflow template referencing secure mode documentation, results: 5
    • Kyverno policy validate Argo Workflows resource, results: 5
    • kyverno, results: 5
    • argo-workflows docs workflow-template-referencing secure, results: 5
    • workflowTemplateRef argo, results: 5
    • kubernetes validating admission policy, results: 5
    • templateReferencing, results: 5

    Sources:

  5. devops-cli-service commented on Nov 22, 2026

    @devops-cli-service
    Contributor

    Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies and Watched files in the section Proposed design of the body.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumpriority/p2-mediumscope/k8ssource/agentstatus/newtype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions