Skip to content

fix(k8s): the Argo controller manages namespace devops for rag-ingest #5289

Done

Description

@dan-petty

Update 2026-11-26 (infra move): the Argo Workflows values are now in dan-petty/homelab.

  • The controller mode (--namespaced, --managed-namespace devops, Role, executor ServiceAccount) is a follow-up issue there.
  • This issue keeps the rag-ingest manifests, the NetworkPolicy, the check and the ADR line.
  • Merge the two parts in step with each other.

Follow-up: dan-petty/homelab#320.


Problem or Motivation

Child 16 of the ADR modernization (#5233). Code. It is the first slice of #4566, which ADR 0021:32 decided, so it needs no new decision.

The review of each record that this item changes:

Proposed Solution & Architectural Design

In k8s/argo-workflows/values.yaml of dan-petty/homelab (follow-up issue): --namespaced and --managed-namespace devops with a Role, templateReferencing Strict and the executor ServiceAccount. rag-ingest uses schedules and mutexes. An offline test refuses schedule, mutex and the singular semaphore. Add a Status History line to 0008. The engine record that supersedes 0008 comes with the last slice of #4566.

So that rag-ingest runs to the end, this item also adds these parts (split of #4566, owner approval of 2026-11-21):

  • executor.serviceAccountName: argo-executor on the rag-ingest WorkflowTemplate. Its pods run as devops-cli, which mounts no service account token, so without it the executor cannot write the task results.
  • One egress rule to the API server on TCP 6443 for each Workflow pod in devops (label workflows.argoproj.io/workflow). The executor of each Workflow pod writes the task results through the API, and devops-default-perimeter has no 6443 egress.
  • A retryStrategy for exit 75 on the rag-ingest template.

With these three parts, rag-ingest can run, so this item does not suspend it. Until an item has these parts, rag-ingest keeps suspend: true. Fact of 2026-11-27: on main, k8s/devops/cronworkflow-rag-ingest.yaml has no suspend field. CronWorkflow infra-drift has the same singular schedule field; #7364 holds that change.

Rules of the ADR process (docs/adr/README.md, #5225) that apply:

  • Use one form for a Status History line, 30 words at most: 'YYYY-MM-DD: Amended by ADR NNNN, section S | Amended by the owner decision in #N, section S | Superseded by ADR NNNN | Fact out of date: (#N) | Living detail moved to (#PR).' The PR that makes a fact of a record wrong adds the line (AGENTS.md rule 8). An agent never edits the body of an accepted record.

Keep these constraints on purpose. The review found a reason for each one:

  • ADR 0003/0017/0021, the sweep is the source of truth and 'webhooks as the only trigger' stays rejected: 25 of 100 deliveries got 403, and about 116 s are lost at each rollout.
  • ADR 0021, coordination keys fail closed (shared request window, holds, identity halt, locks): a local fallback would let N pods pass the owner's cap.
  • ADR 0008, one namespaced controller with a Role and never a ClusterRole, plus minimal CRDs with an offline schema check.

Target Subsystem

The Argo Workflows Helm values (in dan-petty/homelab), k8s/devops/cronworkflow-rag-ingest.yaml, k8s/devops/workflowtemplate-rag-ingest.yaml, k8s/devops/networkpolicy.yaml, docs/adr/.

Existing Tool Considered

The namespaced mode of the Argo Workflows controller (--namespaced, --managed-namespace) in the Helm values. No new tool.

Acceptance Criteria

  • Done in dan-petty/homelab (dan-petty/homelab#320, merged as dan-petty/homelab#418 on 2026-11-27), not here: the Helm values set --namespaced and --managed-namespace devops with a Role and no ClusterRole, templateReferencing: Strict and the executor ServiceAccount.
  • rag-ingest uses schedules and mutexes. An offline test refuses the singular schedule, mutex and semaphore.
  • After the sync, one rag-ingest Workflow runs to the end in namespace devops.
  • ADR 0008 gets a Status History line. The engine record that supersedes ADR 0008 comes with the last slice of feat(k8s): let Argo Workflows run roadmap pods in devops #4566.

Dependencies

This item adds a Status History line to the ADR 0008 file of #5225.

Related

Source: #5233

Alternatives check of 2026-11-25: 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-25, maintained.
Reason: The searches found Argo Workflows, the engine the cluster already runs, whose namespaced controller mode, Role-scoped install, Strict template referencing, executor ServiceAccount and retry strategies cover the issue's need; the remaining gaps are repository-local.

Covers:

  • Namespaced controller mode with --namespaced and --managed-namespace, Role only
  • Strict template referencing from the controller
  • Separate executor ServiceAccount for task result writes
  • Plural schedules on CronWorkflow and synchronization mutexes
  • Step-level retryStrategy with exit-code expressions
  • Scheduled cron workflows and parallelism limits

Lacks:

  • Offline k8s check row that refuses singular schedule, mutex, semaphore
  • NetworkPolicy egress to the API server on TCP 6443 for Workflow pods
  • ADR 0008 Status History line and live end-to-end run proof

Proposed design

Problem statement

Fix the rag-ingest manifests, the NetworkPolicy, the k8s check and the ADR 0008 line. The namespaced Argo controller will manage namespace devops after dan-petty/homelab#418 merges. Controller v4.1.7 refuses the singular schedule field and ignores mutex. The executor has no service account, and the Workflow pods have no API server egress on TCP 6443. No retry covers exit 75. The live proof waits on dan-petty/homelab#418, and a person runs it after the merge.

Acceptance criteria

Requirement: rag-ingest-plural-schedules

The rag-ingest CronWorkflow SHALL set schedules to a list and MUST NOT set schedule.

Scenario: The k8s check accepts the CronWorkflow

  • WHEN uv run devops ci --check --only k8s runs on the change.
  • THEN The command exits zero and prints no finding for k8s/devops/cronworkflow-rag-ingest.yaml.

Requirement: rag-ingest-plural-mutexes

The rag-ingest WorkflowTemplate SHALL set synchronization.mutexes and MUST NOT set mutex or semaphore.

Scenario: The k8s check accepts the WorkflowTemplate

  • WHEN uv run devops ci --check --only k8s runs on the change.
  • THEN The command exits zero and prints no finding for k8s/devops/workflowtemplate-rag-ingest.yaml.

Requirement: k8s-check-refuses-singular-fields

The k8s check MUST fail when a rag-ingest manifest sets schedule, mutex or semaphore.

Scenario: The check row refuses a singular field

  • WHEN uv run devops ci test tests/k8s/test_k8s_catalog.py runs the cases that give the row a manifest with schedule, mutex or semaphore.
  • THEN The cases pass and the row reports one finding that names the singular field.

Requirement: rag-ingest-executor-service-account

The rag-ingest WorkflowTemplate SHALL set spec.executor.serviceAccountName to argo-executor.

Scenario: The k8s check accepts the executor account

  • WHEN uv run devops ci --check --only k8s runs on the change.
  • THEN The command exits zero and prints no finding for k8s/devops/workflowtemplate-rag-ingest.yaml.

Requirement: workflow-pods-reach-the-api-server

The devops network policies SHALL admit one egress rule on TCP 6443 to the API server for the pods that carry the label workflows.argoproj.io/workflow.

Scenario: The k8s check accepts the API server egress rule

  • WHEN uv run devops ci --check --only k8s runs on the change.
  • THEN The command exits zero and prints no finding for k8s/devops/networkpolicy.yaml.

Requirement: rag-ingest-retries-exit-75

The ingest template of the rag-ingest WorkflowTemplate MUST set a retryStrategy that retries exit code 75 and stops after three retries.

Scenario: The k8s check accepts the retry rule

  • WHEN uv run devops ci --check --only k8s runs on the change.
  • THEN The command exits zero and prints no finding for k8s/devops/workflowtemplate-rag-ingest.yaml.

Requirement: adr-0008-status-history-line

ADR 0008 MUST get one dated Status History line in the Fact out of date form, and its body MUST stay unchanged.

Scenario: The ADR test accepts the status history line

  • WHEN uv run devops ci test tests/invariants/test_adr_records.py runs on the amended ADR 0008.
  • THEN The test passes and the body-hash check reports no change.

Requirement: Pending a person after the merge

After this item merges and releases, and after dan-petty/homelab#418 merges and Argo CD syncs, one rag-ingest Workflow MUST run to completion in namespace devops.

Scenario: The live rag-ingest Workflow succeeds

  • WHEN The next rag-ingest schedule starts a Workflow, and a person runs kubectl -n devops get workflow -l workflows.argoproj.io/cron-workflow=rag-ingest -o jsonpath='{.items[*].status.phase}'.
  • THEN The command prints Succeeded.

Existing Tool Considered

argoproj/argo-workflows (https://github.com/argoproj/argo-workflows), verdict in-use. The alternatives check in the issue body gives what the tool covers and lacks. This proposal uses the executor ServiceAccount, plural schedules and mutexes, and the retryStrategy. It adds the repository-local parts that the check lists as lacking: the offline k8s check row, the API server egress rule on TCP 6443, the ADR 0008 Status History line and the live end-to-end proof. The controller mode itself comes from dan-petty/homelab#320.

Key questions

  • Which synchronization fields do the rag-ingest manifests use?: Use schedules on the CronWorkflow and synchronization.mutexes on the WorkflowTemplate. Remove schedule, mutex and semaphore. (best practice) [sources: k8s/devops/cronworkflow-rag-ingest.yaml, k8s/devops/workflowtemplate-rag-ingest.yaml]
    • Chosen: Plural schedules and mutexes. Controller v4.1.7 refuses a CronWorkflow with schedule as SpecError and does not read mutex. The plural fields carry the list that the controller reads.
    • Rejected: Keep the singular fields. The controller refuses or ignores them, so the CronWorkflow does not run and the mutex does not hold.
  • How does the k8s check refuse the singular synchronization fields?: Add a row to the k8s check catalog that fails on schedule, mutex or semaphore in the rag-ingest manifests. Prove it with a unit test of the row and with uv run devops ci --check --only k8s. (best practice) [sources: src/devops_cli/k8s/catalog.py, tests/k8s/test_k8s_catalog.py, k8s/devops/cronworkflow-rag-ingest.yaml]
    • Chosen: A k8s check row. A validator checks a manifest. The issue asks for an offline refusal.
    • Rejected: A pytest test that reads the manifest. A test asserts no value of a manifest. The k8s check row is the validator that does.
    • Rejected: No offline check. The issue requires the offline refusal.
  • How does the executor write the task results?: Set spec.executor.serviceAccountName: argo-executor on the rag-ingest WorkflowTemplate. The homelab change makes ServiceAccount argo-executor, its token Secret and a Role for create and patch on workflowtaskresults. This repository adds no account and no Secret. (best practice) [sources: k8s/devops/workflowtemplate-rag-ingest.yaml]
    • Chosen: Set executor.serviceAccountName to argo-executor. The pod runs as devops-cli, which mounts no token. The executor needs its own account to write the task results.
    • Rejected: Mount the token on the devops-cli pod. It gives the ingest container the rights of the devops-cli ServiceAccount, which the workload does not need.
    • Rejected: Leave the executor with no account. The executor cannot write the task results, so the Workflow fails.
  • Which network policy admits the API writes of the executor?: Add one dedicated egress policy in k8s/devops/networkpolicy.yaml. It selects the pods that carry the label workflows.argoproj.io/workflow and admits TCP 6443 to the API server. (best practice) [sources: k8s/devops/networkpolicy.yaml]
    • Chosen: A dedicated egress policy for the Workflow pods. Only the Workflow pods need API egress. The other pods of devops keep the perimeter rules.
    • Rejected: Add TCP 6443 to devops-default-perimeter-egress. It gives every pod of devops API egress, including the pods that must not have it.
    • Rejected: No egress rule. The perimeter has no 6443 egress, so the executor cannot reach the API server.
  • Which retry rule covers exit code 75?: Set retryStrategy on the ingest template with expression: asInt(lastRetry.exitCode) == 75 and limit: "3". (best practice) [sources: k8s/devops/workflowtemplate-rag-ingest.yaml]
    • Chosen: Retry exit 75 only. The roadmap uses exit 75 for try again later. Only that code retries.
    • Rejected: Retry on any failure. A defect retries three times and delays the alert.
    • Rejected: No retry. A temporary failure fails the Workflow.
  • How does ADR 0008 record the stale controller facts?: Add one dated Status History line in the Fact out of date form. Do not edit the body. (best practice) [sources: docs/adr/README.md, AGENTS.md, tests/invariants/test_adr_records.py]
    • Chosen: One Status History line. docs/adr/README.md and AGENTS.md rule 8 allow only a dated line for an accepted record.
    • Rejected: Edit the ADR body in place. The body-hash test fails. An agent never edits the body of an accepted record.
    • Rejected: Write the superseding engine record now. The issue gives that record to the last slice of feat(k8s): let Argo Workflows run roadmap pods in devops #4566.
  • Does this item amend ADR 0021?: No. This item adds the ADR 0008 line only. The update of 2026-11-26 keeps the ADR line, and the Proposed Solution names ADR 0008. (best practice) [sources: docs/adr/README.md, docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md]
    • Chosen: Change ADR 0008 only. docs/adr/README.md puts a value, a cap and a table row in the OpenSpec change, not in a record. feat(roadmap): move Service work to Workflows and Valkey #4517 holds the step order.
    • Rejected: Amend ADR 0021 in this pull request. The update of 2026-11-26 narrows the item to the ADR 0008 line, and this change makes no fact of ADR 0021 wrong.
  • How is the end-to-end run of rag-ingest proved?: A person runs kubectl -n devops get workflow -l workflows.argoproj.io/cron-workflow=rag-ingest -o jsonpath='{.items[*].status.phase}' after this item releases and dan-petty/homelab#418 merges. The command shows Succeeded. (best practice) [sources: k8s/devops/cronworkflow-rag-ingest.yaml, k8s/devops/workflowtemplate-rag-ingest.yaml]
    • Chosen: A live check after the merge. Only the cluster shows that a Workflow ran to the end in devops.
    • Rejected: An offline test. A test asserts no result of a Workflow run.
  • Does the change need a new tool or library?: No. The repository already uses Argo Workflows. The alternatives check gives verdict in-use. (best practice) [sources: k8s/devops/cronworkflow-rag-ingest.yaml]
    • Chosen: Keep Argo Workflows. The cluster already runs the controller. The namespaced mode covers the namespace scope.
    • Rejected: Add a new tool. No open tool covers the need better than the controller that the cluster runs.
  • Does this item change the infra-drift CronWorkflow?: No. The item names the rag-ingest manifests only. A new issue moves k8s/devops/cronworkflow-infra-drift.yaml to schedules and gives it the executor account and the API egress. That issue must merge before dan-petty/homelab#418. (best practice) [sources: k8s/devops/cronworkflow-infra-drift.yaml, k8s/devops/cronworkflow-rag-ingest.yaml]
    • Chosen: Defer the infra-drift change to a new issue. The update of 2026-11-26 keeps the rag-ingest manifests only. The same controller change breaks infra-drift, so it needs its own item.
    • Rejected: Change both CronWorkflows in this pull request. The update names the rag-ingest manifests only, and AGENTS.md rule 1 gives one item one pull request.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#5225

Moved to new items

#7364

Activity

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

    @dan-petty
    OwnerAuthor
  4. added
    priority/p2-medium
    on Nov 13, 2026
  5. added
    priority/p2-medium
    and removed
    priority/p2-medium
    on Nov 13, 2026
  6. dan-petty commented on Nov 16, 2026

    @dan-petty
    OwnerAuthor

    The service pattern audit of 2026-11-16 (#6059) confirms this item, and it found two more gaps of rag-ingest. Fix them with this item, because the Workflow does not run before this item:

    • kubectl get cronworkflow rag-ingest -n devops shows lastScheduledTime null, and namespace devops has no Workflow. The controller runs with singleNamespace: true (k8s/argo-workflows/values.yaml), so it watches only argo-workflows.
    • The image of k8s/devops/workflowtemplate-rag-ingest.yaml has no tag and no digest, with imagePullPolicy: IfNotPresent, also in the live object. Argo CD Image Updater sets the digest of the Service image through the Kustomize images of Application devops, and Kustomize does not rewrite the image field of a WorkflowTemplate. So a node can run an old image for a long time (service pattern SC5).
    • The template has no retryStrategy. Service pattern JB4 asks for a retry of exit 75 and of the faults of the infrastructure only.
  7. devops-cli-service commented on Nov 17, 2026

    @devops-cli-service
    Contributor

    Waiting for the alternatives check to run. The next refine round looks at the item again after the check records a verdict.

  8. devops-cli-service commented on Nov 19, 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 (8)

    Tools considered:

    Searches run:

    • Argo Workflows controller namespaced mode --namespaced --managed-namespace Role, results: 5
    • Argo Workflows workflow controller namespaced installation helm values namespaces, results: 5
    • "argo-workflows" github repository workflow engine kubernetes, results: 5
    • argo-workflows install namespaced managed namespace single namespace docs, results: 5
    • Argo Workflows namespace isolation installation document, results: 5
    • argo workflоws CronWorkflow schedules mutexes field documentation, results: 5
    • argo-workflows.readthedocs.io workflow-controller-configmap namespaced, results: 5
    • Argo Workflows documentation workflow controller configmap link, results: 5

    Sources:

  9. removed
    status/new
    on Nov 19, 2026
  10. 42 remaining items

  11. added
    status/in-review
    and removed
    status/in-progress
    on Nov 27, 2026
  12. removed
    status/in-review
    owner/agent
    on Nov 27, 2026
  13. devops-cli-service commented on Nov 27, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-27 18:39 UTC

  14. dan-petty commented on Nov 27, 2026

    @dan-petty
    OwnerAuthor

    Live proof, 2026-11-27, release 0.228.2 (Application devops synced at 18:28 UTC):

    $ kubectl -n devops get workflow -l workflows.argoproj.io/cron-workflow=rag-ingest -o jsonpath='{.items[*].status.phase}'
    Succeeded Running
    
    • rag-ingest-1795804020 ran from 18:27:00 to 19:40:30 UTC and ended Succeeded, with exit 0 and no retry. The executor wrote its task results with argo-executor through argo-workflow-egress (fix(k8s): run infra-drift on Argo v4 with API server egress #7410).
    • The first run is also the first since the controller refused the CronWorkflow at about 01:38 UTC. The controller then scheduled the next run, rag-ingest-1795808520, at 19:42:00 UTC, 90 seconds after the first ended.

    The criterion passes. A new defect: each run embeds every file again, because the cache of the indexer is on an emptyDir; #7467 holds it.

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/p1-highscope/k8ssource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions