Repository navigation
fix(k8s): run infra-drift on Argo v4 with API server egress - #7410
Conversation
Evidence of the change (head
|
| Command | Result |
|---|---|
uv run devops ci --check --only k8s,kube-linter,lint,format,typecheck,docs,openspec,test-tree |
9 rows pass; k8s: 186 cases, 0 failed |
uv run devops ci fail-to-pass --base origin/main |
failed on base, passed on head: k8s runner.check_only_the_service_pod_and_the_workflow_pods_may_reach_the_api_server (1 of 186 cases failed on base, 0 of 186 on head) |
uv run devops k8s validate k8s/devops/networkpolicy.yaml |
all manifests are valid schemas |
uv run devops openspec archive 7364-infra-drift-schedules-and-executor |
every spec and change validates |
kubectl kustomize k8s/devops renders:
- CronWorkflow
infra-drift:schedules: ['0 6 * * *'], noschedule,concurrencyPolicy: Forbid. - WorkflowTemplate
infra-drift:synchronization: {"mutexes": [{"name": "infra-drift"}]},executor: {"serviceAccountName": "argo-executor"},serviceAccountName: devops-cli. - NetworkPolicy
argo-workflow-egress:podSelector: {"matchExpressions": [{"key": "workflows.argoproj.io/workflow", "operator": "Exists"}]},policyTypes: ["Egress"], one rule: TCP 6443 to0.0.0.0/0except169.254.169.254/32. - The policies with egress on TCP 6443:
argo-workflow-egressandroadmap-service-egress, and no other.
A changed security check
The k8s row held check_only_the_service_pod_may_reach_the_api_server, which allowed exactly one policy with TCP 6443. The new policy makes that check fail, so the change replaces it with check_only_the_service_pod_and_the_workflow_pods_may_reach_the_api_server. It pins the selector, the type and the rules of both policies, and it still fails on any other policy with TCP 6443 and on TCP 6443 in the perimeter. The label check of the Job pod templates now also fails on the label workflows.argoproj.io/workflow. The rule for the Workflow pods is the owner-approved part of #5289 (split of #4566, 2026-11-21).
Pending a person after the merge
Argo CD syncs Application devops. Then submit one Workflow from cronwf/infra-drift in namespace devops, or wait for the run of 06:00 UTC, and run:
kubectl -n devops get workflow -l workflows.argoproj.io/cron-workflow=infra-drift -o jsonpath='{.items[*].status.phase}'
The command must print Succeeded. The controller log must show no invalid cron workflow line for devops/infra-drift.
Check resultsHead commit:
Fail-to-pass run: https://github.com/dan-petty/devops-cli/actions/runs/46009141017/job/140539849168 Skipped check: Plan Check |
🤖 I have created a release *beep* *boop* --- ## [0.225.0](v0.224.3...v0.225.0) (2026-11-27) ### Features * **k8s:** move a claim to another storage class with volume move ([#7409](#7409)) ([19bb409](19bb409)) ### Bug Fixes * **k8s:** run infra-drift on Argo v4 with API server egress ([#7410](#7410)) ([6546f84](6546f84)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
The Argo Workflows controller v4.1.7 now manages namespace
devops. It refuses CronWorkflowinfra-drift, which sets the singular fieldschedule, so the daily drift check does not run. The WorkflowTemplate sets the singularmutex, which the controller does not read. The executor has no account with a token, and no policy lets a Workflow pod reach the API server, so each Workflow ends inError.The CronWorkflow now uses
schedules. The WorkflowTemplate usesmutexesandexecutor.serviceAccountName: argo-executor. The pod keeps the accountdevops-cli, which mounts no token. The new policyargo-workflow-egressselects each pod with the labelworkflows.argoproj.io/workflowand lets it reach the API server on TCP 6443 only, asroadmap-service-egressdoes. Thek8srow pins these two policies and refuses any other policy with TCP 6443.Closes #7364
Change:
openspec/changes/archive/2026-11-27-7364-infra-drift-schedules-and-executor/