Repository navigation
Description
Problem or Motivation
The owner said on 2026-11-12: "once infra environment repo management is supported, we can move homelab configuration artifacts to that repo and update argocd config". devops-cli now holds two kinds of content under k8s/: the environment of the homelab (Argo CD apps, Helm values, overlays, dashboards, alert rules, Image Updater config) and product content that devops needs or ships. Code, tests and CI read the environment files at fixed paths in this repository (DEFAULT_K8S_DIR, CONST_K8S_ARGOCD_APPLICATION_DIRS, PAUSE_PARENTS, CONST_K8S_GITEA_APPLICATIONS, CONST_K8S_OLLAMA_PROFILES_PATH, the dashboards folder default, the gateway and profile paths, the "homelab" Cloudflare policy names). The files cannot move while the product reads them here.
devops k8s image-pins and argocd_gate also read each Application source from the local root. Today _value_file maps every $ref to the local root (image_pins.py:183-185), and a path source always renders from the local root (image_pins.py:244-245). argocd_gate requires the origin repoURL. tests/support/k8s_tree.py assumes the prefix $values/. In the homelab copy, Application devops names devops-cli, and Application prometheus has a second ref on devops-cli. So these checks cannot check the homelab tree.
Proposed Solution & Architectural Design
Phase 2 of tracker #5120 (design section 10), step 4 of the corrected plan on #5120. This item is one pull request (PR 1), before the source commit S of dan-petty/homelab#23 (plan step 9). The fixture work (the old item 4) is #5298 now. It must merge before #5134 step 6 (plan step 17).
- (PR 1) The product commands read the environment tree from the profile fact
kubernetes.dirof the infra repo, which the repo declares in.devops/project.toml, or from the option--k8s-dir.infra.repos[]has nok8s_dirkey:InfraRepoConfigforbids extra keys (settings.py:1578-1606). The commands aredevops k8s deploy-stack,bootstrap,teardown-stack,image-pins,lint,check-deprecated,devops grafana dashboards,devops ai gateway,devops k8s ollama,argocd_gateand the roadmap stage paths.deploy-stackkeeps the product root (k8s/devops) apart from the environment root. - (PR 1) Foreign-source support.
image-pinsandargocd_gateresolve each$refand each path source by its repoURL. The origin maps to the local root. A public repository that is not the origin is fetched at its targetRevision.tests/support/k8s_tree.pyaccepts a ref name other than$values. Also add a kustomization-path mode toimage-pins(for examplek8s/devops). - (PR 1) The environment data in
srcbecomes settings, or comes from the environment root: the constants listed above,DEFAULT_K8S_DIRand the paths that are joined to it at import time (stack_lifecycle.py:120-331), theDEFAULT_LLM_*paths,DEFAULT_GRAFANA_DASHBOARDS_DIR, the path ofollama prune, theargo.pydefaults, the team defaulthomelaband the Cloudflare Access names.CONST_K8S_ARGOCD_HOMELAB_APPLICATIONSdoes not become a setting, because feat(argocd): read the environment from the homelab repo #5134 step 5c (plan step 15) deletes it. - The product-contract tests on a fixture tree are in test(k8s): test the product contracts on a fixture tree #5298.
k8s/devops/*stays as a Kustomize base that devops-cli ships (Service, runner CronJob template, mcp-server, admission policy).- A list in the PR names each reader that stays, moves or is deleted.
- Stays in devops-cli:
test_k8s_crawl4ai.py,test_k8s_searxng.py,third-party-image-scan.yml, the promtool step,trivy config, the Renovate kubernetes manager scoped to^k8s/devops/, andimage-pins.ymlscoped tok8s/devops/**. Only the cloudflared and README checks of the two test files change: the cloudflared checks move to homelab, and the README checks follow the product sections todocs/(docs(k8s): move the product README sections to docs/ #5293), as the README read oftest_runner_image.pydoes. - Moves to dan-petty/homelab (feat(k8s): run the environment checks in homelab CI #5296 brings them to homelab CI):
test_k8s_argocd_apps.py, the manifest part oftest_k8s_manifests.py, thek8srow ofdevops ci, the environment alert and dashboard tests, the cloudflared checks, and the other k8s managers of.github/renovate.json.sre-service.jsonandllm-stack.jsonare environment dashboards. - Deleted: the dead design-token filters of
ci.yml, together withDESIGN_FILTERintest_workflow_contracts.py:1880-1891in the same PR; the cross-repo pin tests.
- Stays in devops-cli:
- No file moves in this item. The environment files stay until feat(argocd): read the environment from the homelab repo #5134 step 6.
Order and dependencies (corrected plan on #5120):
- PR 1 is plan step 4. It must merge before S, and release vX (plan step 6) must include it, because the homelab#23 CI runs
image-pinsanddashboards lintfrom vX. - refactor(k8s): split the product dashboards and rules in place #5292 (product split, plan step 2) moves the product dashboards and rules first. PR 1 can go in parallel.
- test(k8s): test the product contracts on a fixture tree #5298 (the fixture tests) must merge before feat(argocd): read the environment from the homelab repo #5134 step 6 (plan step 17).
- feat(k8s): run the environment checks in homelab CI #5296 (homelab environment checks, plan step 16) takes the checks that move.
Target Subsystem
Kubernetes & Minikube Automation
Existing Tool Considered
Kustomize remote bases and the settings system already cover the need; the work is to remove fixed paths. Cost: about 6M tokens to build, 0.5M a quarter to keep, 8 hours. The foreign-source support adds about 2M tokens and 3 hours.
Acceptance Criteria
- With
kubernetes.diror--k8s-dirpointing at a copy ofk8s/outside this repository,devops k8s image-pins,deploy-stack --dry-runanddevops grafana dashboards lintgive the same result as today. -
image-pinsandargocd_gatepass on a test tree whose Applicationdevopsnames devops-clik8s/devopsand whose Applicationprometheushas two refs. -
image-pinsaccepts a kustomization path (k8s/devops). -
git grepfinds no environment constant listed above insrc/. - The PR lists each kept, moved and deleted reader.
-
uv run devops cipasses.
Dependencies
#5121 (closed: the infra settings and the project profile). This item blocks dan-petty/homelab#23 through release vX. #5298 (the fixture tests) blocks #5134 step 6.
Activity
dan-petty commentedon Nov 12, 2026
Both manage infra repos; #5120 is the umbrella feature and the candidate is its Phase 2 (reading the environment tree from the infra repo).chore(openspec): archive 5131-environment-root-from-the-infra-repo
refactor(k8s): read the environment tree from the infra repo
docs(k8s): describe the environment tree and its settings
test(k8s): expect the product rules under the product base
test(grafana): lint only the tree dashboards in an infra repo
chore(openspec): archive 5131-environment-root-from-the-infra-repo
devops-cli-service commentedon Nov 13, 2026
Released in v0.125.4: https://github.com/dan-petty/devops-cli/releases/tag/v0.125.4
devops-cli-service commentedon Nov 13, 2026
Live since 2026-11-13 02:53 UTC