Repository navigation
Description
Split from #5289.
k8s/devops/cronworkflow-infra-drift.yaml sets the singular schedule field. Controller v4.1.7 gives that CronWorkflow the condition SpecError and does not run it. k8s/devops/workflowtemplate-infra-drift.yaml sets the singular mutex field, which the controller does not read. Its executor has no service account. Its Workflow pods have no API server egress on TCP 6443. Issue #5289 changes the rag-ingest manifests only, so this part gets its own item. This item must merge before dan-petty/homelab#418 merges, else Application devops holds two CronWorkflows in SpecError until the change is live. Acceptance criteria: (1) The CronWorkflow sets schedules and sets no schedule; uv run devops ci --check --only k8s exits zero. (2) The WorkflowTemplate sets synchronization.mutexes and spec.executor.serviceAccountName: argo-executor; uv run devops ci --check --only k8s exits zero. (3) The Workflow pods get one egress rule on TCP 6443 to the API server; uv run devops ci --check --only k8s exits zero. (4) A person runs kubectl -n devops get workflow -l workflows.argoproj.io/cron-workflow=infra-drift -o jsonpath='{.items[*].status.phase}' after the merge; the command prints Succeeded.
Proposed design
Problem statement
The infra-drift Argo manifests use fields that controller v4.1.7 does not read, so the CronWorkflow stays in SpecError and the WorkflowTemplate executor lacks its service account and API server egress. The change aligns the manifests with the controller schema and the network policy. It must merge before dan-petty/homelab#418 merges.
Acceptance criteria
Requirement: CronWorkflow uses schedules
The infra-drift CronWorkflow SHALL set spec.schedules and SHALL NOT set spec.schedule.
Scenario: The k8s validator accepts the CronWorkflow
- WHEN
uv run devops ci --check --only k8sruns on the changedk8s/devops/cronworkflow-infra-drift.yaml - THEN the command exits zero and reports no error for the CronWorkflow
Requirement: WorkflowTemplate uses mutexes and executor account
The infra-drift WorkflowTemplate SHALL set spec.synchronization.mutexes and spec.executor.serviceAccountName: argo-executor, and SHALL NOT set spec.synchronization.mutex.
Scenario: The k8s validator accepts the WorkflowTemplate
- WHEN
uv run devops ci --check --only k8sruns on the changedk8s/devops/workflowtemplate-infra-drift.yaml - THEN the command exits zero and reports no error for the WorkflowTemplate
Requirement: Workflow pods reach the API server on TCP 6443
The infra-drift Workflow pods SHALL have one egress rule that permits TCP 6443 to the Kubernetes API server.
Scenario: The k8s validator accepts the NetworkPolicy
- WHEN
uv run devops ci --check --only k8sruns on the changed NetworkPolicy for the infra-drift pod labels - THEN the command exits zero
Requirement: Pending a person after the merge
After the merge, the infra-drift CronWorkflow SHALL produce a Workflow that reaches the phase Succeeded.
Scenario: A person checks the latest Workflow phase
- WHEN a person runs
kubectl -n devops get workflow -l workflows.argoproj.io/cron-workflow=infra-drift -o jsonpath='{.items[*].status.phase}'after the merge - THEN the command prints
Succeeded
Existing Tool Considered
No alternatives check has run. Argo Workflows v4.1.7, an open and maintained controller already in use, covers the CronWorkflow schedules and WorkflowTemplate synchronization.mutexes schema; Kubernetes NetworkPolicy covers the TCP 6443 egress rule. The change writes no new code, so it has no build cost.
Key questions
- Which CronWorkflow field holds the schedule in controller v4.1.7?:
spec.schedulesholds the schedule as a list. The singularspec.schedulefield is invalid and causesSpecError. [sources: k8s/devops/cronworkflow-infra-drift.yaml] - Which WorkflowTemplate field holds the mutex in controller v4.1.7?:
spec.synchronization.mutexesholds the mutex as a list. The singularsynchronization.mutexfield is not read. [sources: k8s/devops/workflowtemplate-infra-drift.yaml, docs/SERVICE_PATTERNS.md:52] - Which service account does the executor use?: The executor uses the dedicated
argo-executorservice account atspec.executor.serviceAccountName. (best practice) [sources: k8s/devops/workflowtemplate-infra-drift.yaml]- Chosen: Dedicated
argo-executorservice account. It gives the executor its own identity and meets the required value. - Rejected: Reuse the
devops-cliworkflow service account. It gives the executor the workflow permissions and does not meet the required value.
- Chosen: Dedicated
- How do the Workflow pods get API server egress on TCP 6443?: A NetworkPolicy egress rule selects the infra-drift pod labels and permits TCP 6443 to the Kubernetes API server. (best practice) [sources: k8s/devops/workflowtemplate-infra-drift.yaml]
- Chosen: Allow TCP 6443 egress to the API server only. It gives the least egress that the executor needs.
- Rejected: Allow all egress from the Workflow pods. It is broader than the need and weakens the network policy.
- Rejected: Use host network. It bypasses the pod network and is not required.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
devops-cli-service commentedon Nov 27, 2026
The CronWorkflow is in SpecError and does not run, which is a service job failure.#5129 delivered the infra-drift CronWorkflow and WorkflowTemplate; this candidate fixes field errors in those manifests.[-]fix(k8s): move the infra-drift CronWorkflow to plural schedules and the executor account[/-][+]fix(k8s): Fix infra-drift CronWorkflow schedules and executor[/+]devops-cli-service commentedon Nov 27, 2026
The job shortened the title of this item. The summary had 78 characters, and the limit is 60. The type and the scope stay.
fix(k8s): move the infra-drift CronWorkflow to plural schedules and the executor accountdevops-cli-service commentedon Nov 27, 2026
Next step: the alternatives check records a verdict. See the section Proposed design of the body.
dan-petty commentedon Nov 27, 2026
Evidence of 2026-11-27: the API server egress gap stops each Workflow in
devops, not onlyinfra-drift.For dan-petty/homelab#335 I ran one Workflow in
devopsfrom a test copy of WorkflowTemplatedevops-cli-version, withspec.executor.serviceAccountName: argo-executor. Themaincontainer ran (devops-cli 0.224.0). Thewaitcontainer then failed:So the Workflow ended in
Error. Indevops, onlyroadmap-service-egress(podsapp.kubernetes.io/name: roadmap-service) allows TCP 6443.devops-default-perimeter-egressallows TCP 443 to public addresses only. The controller gives each Workflow pod the labelworkflows.argoproj.io/workflow, so one rule for that label would coverinfra-drift,rag-ingest(#5289) and each later template. I deleted the test objects.devops-cli-service commentedon Nov 27, 2026
Released in v0.225.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.225.0
dan-petty commentedon Nov 27, 2026
Live check of 2026-11-27, release 0.225.0 (Argo CD synced Application
devopsafter dan-petty/homelab#546, merged at 15:25 UTC).infra-drift:spec.schedulesis["0 6 * * *"], it has no condition, and the controller log of the last 15 minutes has nomust have at least one scheduleline for it.infra-drifthasexecutor.serviceAccountName: argo-executorandsynchronization.mutexes, and policyargo-workflow-egressexists.argo submit -n devops --from cronwf/infra-driftat 15:35 UTC made Workflowinfra-drift-proof-szwrxand its pod. The pod stayed inInit:0/1:FailedMount: MountVolume.SetUp failed for volume "ssh-key" : secret "infra-ssh-key" not found. I deleted the Workflow.So criterion 4 (
Succeeded) is not proved. The stop is a gap of #5129, not of this change:push-secretshas no row fordevops/infra-ssh-key, so a person cannot write it. #7428 holds it. The executor path (API egress, task results) is proved only after a pod of a Workflow runs.devops-cli-service commentedon Nov 27, 2026
Live since 2026-11-27 15:40 UTC
dan-petty commentedon Nov 27, 2026
Live proof, 2026-11-27 19:26 UTC, after the owner pushed Secret
devops/infra-ssh-key(#7428):infra-drift-manual-nsc84, submitted fromcronwf/infra-drift, ran from 19:25:59 to 19:26:09 UTC and endedSucceeded, with exit 0. The pod mountedssh-keywith noFailedMountevent.waitcontainer of the executor wrote the task result through the API server. Before this change, the same write failed withdial tcp 10.43.0.1:443: connect: connection refused. Soexecutor.serviceAccountName: argo-executorand policyargo-workflow-egresswork.Criterion 4 prints
Succeeded, but the run checked no repository: the cluster config has noinfra.repos, anddrift --allthen exits 0. #7460 holds that gap.