Skip to content

fix(k8s): deploy-stack --stack all and the argo cd applications deploy the same manifests and charts #1675

Closed

Description

@dan-petty

Friction

devops k8s deploy-stack --stack all and the Argo CD Applications deploy different sets. On a cluster without Argo CD, deploy-stack installs no Traefik, no Ingresses or IngressRoutes, no Portkey, no valkey-runs and no GPU feature discovery, although Argo CD runs all of them on the homelab; in the other direction it registers k8s/argocd/networkpolicy.yaml, which no Application deploys. This breaks the AGENTS.md rule that deploy-stack deploys every manifest, and the tests hide it: the Traefik row is injected by hand and the Portkey and valkey-runs perimeters are exempted. k8s/README.md tells people to apply valkey-runs by hand although Argo CD already deploys it.

Evidence

Live, read-only, 2026-10-17 (main = 3dd7fa6). The homelab is complete because Application cluster exists and deploy-stack delegates to Argo CD; the gap is on the native path:

  • Deployment kube-system/traefik belongs to Application traefik (chart traefik-41.6.0). k3s runs with --disable traefik, so this is the cluster's only ingress controller.
  • 18 Ingresses and IngressRoute kube-system/traefik-dashboard belong to Application ingress (k8s/ingress/ingress-routes.yaml).
  • Deployments llm/portkey and llm/valkey-runs carry tracking ids llm:apps/Deployment:llm/portkey and llm:apps/Deployment:llm/valkey-runs.
  • DaemonSet default/gpu-feature-discovery (3/3) belongs to Application gpu-feature-discovery.

Repo (src/devops_cli/commands/k8s/stack_lifecycle.py):

  • _HELM_REPOS_BY_STACK (:54-70) has no traefik repo, and _HELM_RELEASES_BY_STACK (:79-172) no traefik release.
  • _MANIFESTS_BY_STACK["llm"] (:181-190) omits k8s/llm/portkey/{configmap,deployment,service,networkpolicy}.yaml and k8s/llm/valkey-runs.yaml, which k8s/llm/kustomization.yaml lists.
  • _KUSTOMIZATIONS_BY_STACK holds only monitoring. Nothing in src/ references k8s/gpu-feature-discovery or k8s/ingress/ingress-routes.yaml.
  • tests/test_k8s_argocd_apps.py:112 injects traefik into the expected-release map by hand; tests/test_k8s_network_policies.py:23 (UNDEPLOYED_NETWORK_POLICIES) exempts portkey-perimeter and valkey-runs-perimeter.
  • k8s/README.md:69 says valkey-runs is "not deployed by deploy-stack; apply k8s/llm/valkey-runs.yaml yourself". cloudflared's default target is Traefik (src/devops_cli/config/constants.py:600).
  • docs/agent/tasks/task-1485-argocd-image-updater.md:34 already noted "Traefik and gpu-feature-discovery have no native release either" without filing it.

Remedy

  1. Tests first: replace the hand-injected traefik entry (tests/test_k8s_argocd_apps.py:112) with a test that maps every Application in k8s/argocd/apps to a deploy-stack counterpart (each chart to a release with the same version and values file, each path to a manifest list or kustomization). argocd-image-updater is the only allowed exception (k8s/README.md Service Image Updates; task-1485). Drop both UNDEPLOYED_NETWORK_POLICIES exemptions. Both changes fail today.
  2. stack_lifecycle.py:
    • Traefik: repo traefik https://traefik.github.io/charts in _HELM_REPOS_BY_STACK["infra"], and a release (chart traefik/traefik, the version k8s/argocd/apps/traefik.yaml pins, namespace kube-system, values k8s/ingress/traefik-values.yaml). Stock k3s ships its own Traefik HelmChart, so document (and warn in deploy-stack) that k3s must run with --disable traefik, rather than letting _adopt_helm_resource_if_conflict take over k3s's copy.
    • Path("gpu-feature-discovery") in _KUSTOMIZATIONS_BY_STACK["infra"] (a plain DaemonSet kustomization).
    • k8s/llm/portkey/{configmap,deployment,service,networkpolicy}.yaml and k8s/llm/valkey-runs.yaml in _MANIFESTS_BY_STACK["llm"]; they apply after step 5 pushes llm/valkey-runs-auth.
    • k8s/ingress/ingress-routes.yaml in a manifest list, so _apply_manifest_files substitutes the domain; never a raw kubectl apply -k, which would apply the example.com placeholders. Keep the roadmap-service Ingress single-owned (the homelab overlay deletes the duplicate in ingress-routes.yaml for that reason).
  3. The reverse gap (argocd-default-perimeter applied by deploy-stack but no Application) is settled by the argocd perimeter item; this item's test must accept its outcome.
  4. k8s/README.md:69 and the Cloudflare step: deploy-stack deploys valkey-runs and the ingress routes.
  5. changelog.d/<issue>.md under ### Fixed.
    Verify on the devcontainer's minikube (native path): deploy-stack --stack all brings up Traefik, the Ingresses, Portkey, valkey-runs and GPU feature discovery (which schedules no pod without GPUs), and --dry-run lists them without any request.

Priority: P2. Severity medium-to-low: latent on the homelab, but it breaks the AGENTS.md deploy-everything rule and two tests mask it.

Proposed design

Problem statement

The devops k8s deploy-stack --stack all command and Argo CD Applications deploy different sets of Kubernetes manifests and charts, causing inconsistency. Specifically, deploy-stack omits Traefik, Ingresses, IngressRoutes, Portkey, valkey-runs, and GPU feature discovery, while Argo CD deploys them. This breaks the rule that deploy-stack should deploy every manifest and is hidden by tests that mask the discrepancy.

Acceptance criteria

  • Criterion 1: The deploy-stack command with --stack all correctly deploys Traefik chart
    Verification: Run deploy-stack --stack all and verify that a Traefik deployment exists in kube-system namespace
  • Criterion 2: The deploy-stack command with --stack all correctly deploys Ingresses and IngressRoutes
    Verification: Run deploy-stack --stack all and verify that 18 Ingresses and IngressRoute kube-system/traefik-dashboard exist
  • Criterion 3: The deploy-stack command with --stack all correctly deploys Portkey and valkey-runs
    Verification: Run deploy-stack --stack all and verify that Deployments llm/portkey and llm/valkey-runs exist
  • Criterion 4: The deploy-stack command with --stack all correctly deploys GPU feature discovery DaemonSet
    Verification: Run deploy-stack --stack all and verify that DaemonSet default/gpu-feature-discovery exists
  • Criterion 5: All tests pass without hand-injected traefik entry or exemptions for network policies
    Verification: Run the test suite with replaced traefik mapping and removed exemptions, ensuring no failures

Key questions

  • What Helm repositories and releases are currently defined in _HELM_REPOS_BY_STACK and _HELM_RELEASES_BY_STACK for infra stack?: _HELM_REPOS_BY_STACK has no traefik repo, and _HELM_RELEASES_BY_STACK has no traefik release. [sources: src/devops_cli/commands/k8s/stack_lifecycle.py:54-70, src/devops_cli/commands/k8s/stack_lifecycle.py:79-172]
  • What manifests are currently defined in _MANIFESTS_BY_STACK["llm"]?: _MANIFESTS_BY_STACK["llm"] omits k8s/llm/portkey/{configmap,deployment,service,networkpolicy}.yaml and k8s/llm/valkey-runs.yaml. [sources: src/devops_cli/commands/k8s/stack_lifecycle.py:181-190]
  • What kustomizations are defined in _KUSTOMIZATIONS_BY_STACK?: _KUSTOMIZATIONS_BY_STACK holds only monitoring. Nothing references k8s/gpu-feature-discovery or k8s/ingress/ingress-routes.yaml. [sources: src/devops_cli/commands/k8s/stack_lifecycle.py:194-203]
  • What changes are required to make deploy-stack consistent with Argo CD?: Tests need to be updated to map Applications to deploy-stack counterparts, stack_lifecycle.py needs Traefik repo and release added, gpu-feature-discovery kustomization added, portkey and valkey-runs manifests added, ingress-routes.yaml manifest list added, k8s/README.md needs update to reflect that valkey-runs is now deployed by deploy-stack, and changelog.d file needs to be created. (proposed) [sources: src/devops_cli/commands/k8s/stack_lifecycle.py:194-203, src/devops_cli/commands/k8s/stack_lifecycle.py:54-70, src/devops_cli/commands/k8s/stack_lifecycle.py:79-172, src/devops_cli/commands/k8s/stack_lifecycle.py:181-190, tests/test_k8s_argocd_apps.py:112, tests/test_k8s_network_policies.py:23, k8s/README.md:69]

Fit

Needs splitting into 4 items:

  1. Update tests to map Argo CD Applications to deploy-stack counterparts
  2. Modify stack_lifecycle.py to add Traefik, gpu-feature-discovery, portkey, valkey-runs and ingress routes
  3. Update k8s/README.md to reflect that valkey-runs is now deployed by deploy-stack
  4. Create changelog.d file for the fix

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/bug
    on Oct 18, 2026
  2. dan-petty commented on Oct 18, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.

    • Type: type/bug. The candidate describes a discrepancy between deploy-stack and Argo CD applications, which is a bug in the system's behavior.
    • Priority: P1-High. The issue breaks a core rule of the project and affects how manifests are deployed across different paths.
    • Value: High. Fixing this ensures consistent deployment behavior, which is critical for the stability and correctness of the system.
    • Effort: High. The fix involves modifying core deployment logic and test expectations, requiring significant changes to multiple files and potentially introducing regressions.
  3. dan-petty commented on Oct 18, 2026

    @dan-petty
    OwnerAuthor

    Proposal needs splitting into 4 items at 25e2cda (see proposed design in issue body).

  4. added this to the v0.2.37 milestone on Oct 19, 2026
  5. added
    status/in-progress
    status/in-review
    and removed
    status/in-progress
    on Oct 19, 2026
  6. dan-petty commented on Oct 20, 2026

    @dan-petty
    OwnerAuthor

    What changed

    #1712, merged into release/v0.2.37 as 07f8291.

    Closes #1675

    8 file(s) changed.

    How it was verified

    Check runs at 8be7d65:

    • Prune PR DevContainer Images: pass
    • Audit Defect PR Hardening: skipping
    • zizmor: pass
    • devops-cli: pass
    • bandit: pass
    • CodeQL: pass
    • Fail-to-Pass Self-Check: pass
    • Rule Pack Tests: pass
    • Changed-Test Independence: pass
    • Tests & Coverage: pass
    • Analyze (python): pass
    • Fail-to-Pass Check: pass
    • Analyze (actions): pass
    • Static Analysis: pass
    • DevContainer Image: skipping
    • Service Image: skipping
    • Dependency Freshness: skipping

    Acceptance Criteria of docs/agent/tasks/task-1675-deploy-stack-parity-with-argocd.md:

    • tests/test_k8s_network_policies.py dropped all exemptions in UNDEPLOYED_NETWORK_POLICIES and passes.
    • tests/test_k8s_argocd_apps.py removed hand-injected Traefik mapping and verifies that every Application in k8s/argocd/apps maps to a deploy-stack counterpart.
    • _adopt_helm_resource_if_conflict warns and returns False when release name is traefik.
    • _HELM_REPOS_BY_STACK, _HELM_RELEASES_BY_STACK, _KUSTOMIZATIONS_BY_STACK, and _MANIFESTS_BY_STACK in stack_lifecycle.py include all missing counterparts.
    • k8s/README.md documents valkey-runs and Ingress route deployment by deploy-stack and k3s --disable traefik.
    • All test suites and quality gates pass locally (uv run devops ci).
    • changelog.d/1675.md.
  7. removed
    status/in-review
    on Oct 30, 2026
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

    source/agenttype/bug

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions