Repository navigation
Description
Problem or Motivation
After dan-petty/homelab#23, the homelab repo holds a copy of the environment, but every Application of Argo CD still reads dan-petty/devops-cli main (repoURL https://github.com/dan-petty/devops-cli, targetRevision main, prune: true, selfHeal: true). The private values still reach Argo CD as deploy-time overrides on the Applications devops, ingress and mattermost (live patches: devops 1, ingress 19, mattermost 1), with ignoreDifferences in k8s/argocd/bootstrap/cluster.yaml (#1290). #1291 planned a private config repo on Gitea for those values; the owner's direction of 2026-11-12 picks the private repo dan-petty/homelab instead, so this item supersedes #1291.
Proposed Solution & Architectural Design
Phase 2 of tracker #5120 (design section 10). The plan steps are the steps of the corrected plan on #5120. Do the work in this order:
- Owner (plan step 7). The owner gives the existing GitHub App
devops-cli-argocdthe permission Contents: read and installs it on dan-petty/homelab. The owner creates the Argo CD repository credential object in namespaceargocd(labelargocd.argoproj.io/secret-type=repository, urlhttps://github.com/dan-petty/homelab, thegithubApp*fields). There is no deploy key. The credential never goes into git. The owner also installsdevops-cli-argocdwith Deployments: write on homelab before step 3, so the deploy statuses of 11 Applications do not fail. The installation ID stays the same, soargocd-notifications-secretdoes not change. Check:argocd repo list --coreshows homelab as Successful. The credential object is listed by name only. - Agent, a person merges (plan step 8). Add
https://github.com/dan-petty/homelabtosourceReposof the AppProjectshomelab(projects.yaml:12) andhomelab-system(:140), and keep devops-cli. Add the repository credential object toorphanedResources.ignore. Add thedocs/runbook of plan steps 10-17 with roles only. The private-domain guard feat(security): refuse a diff that names the configured domain #5295 merges in the same plan step. Check:kubectl get appproject homelab homelab-system -n argocd -o jsonpath='{.spec.sourceRepos}'lists homelab, and all 34 Applications stay Synced.- Then dan-petty/homelab#23 (plan step 9) copies the environment at devops-cli commit S, which is taken after this step.
- Pre-checks before step 3 (plan step 10), on the day of the switch. Run
git diff --stat S origin/main -- <environment paths>andgit diff --quiet vX origin/main -- k8s/devops/dashboards. If either shows a change, sync the copy again with a homelab PR and run the homelab#23 checks again. Post the baseline here with counts and key names only: 34 Applications, 33 Synced and Healthy and 1 Progressing;requiresPruningonly onargocd, 3 hook objects; override keys ondevops,ingressandmattermost. Make sure that 0 Applications haveautomated.enabled: false(a volume move pauses an Application this way,volume_move.py:234, 697), and that no volume move or node operation is in progress. - Prerequisites before step 3: the released fetch fix fix(k8s): deploy-stack fetches a private Application repo #5294 (
argocd_overrides.py:97-108, in release vX), the credential and both App installations of step 1, the owner decisions on protection and Actions minutes (made on 2026-11-13, below), 0 paused Applications and no volume move in progress.
- The switch, agent after the owner says go (plan step 11). The agent asks the owner for go when plan steps 1 to 10 pass their checks. Write homelab origin/main
k8s/argocd/bootstrap/bootstrap.yamlto a file in a temporary directory. Runuv run devops argo cd apps bootstrap-gitops --root-app <that file>. It creates or merge-patches the livebootstrap(crd.py:225-246).bootstrapsyncsclusterfrom homelab, andclusterapplies the 32 children. Every git source and every$valuesref names homelab, except Applicationdevops(devops-clik8s/devopsonmain) and the product ref of Applicationprometheus(devops-climain). Prune is off in all 34 Applications of the copy,bootstrapandclusterincluded. - Check (plan step 11). Sync and health equal the baseline.
argocd app diff --core --exit-codeis 0 for all 34 Applications. There are 0 pruned and 0 PruneSkipped results, andrequiresPruningequals the baseline. The override keys are still there.IngressServesPlaceholderHostdoes not fire. Post exit codes and counts only, never diff output or Application YAML. The Applications keep their names, so tracking does not change: no orphan, no duplicate.- Freeze and soak (plan step 12). Merge a temporary devops-cli CI check that refuses changes to the old environment paths in devops-cli. It starts after the switch, not at S, because devops-cli main deploys until the switch. Soak for at least 1 day and 1 release. Check: deploy statuses appear on homelab commits for 11 Applications and on devops-cli commits for
devops. At the release, the digest on Applicationdevopsmoves. No ComparisonError.
- Freeze and soak (plan step 12). Merge a temporary devops-cli CI check that refuses changes to the old environment paths in devops-cli. It starts after the switch, not at S, because devops-cli main deploys until the switch. Soak for at least 1 day and 1 release. Check: deploy statuses appear on homelab commits for 11 Applications and on devops-cli commits for
- Private values into git and prune on, in 3 parts.
- 5a, homelab (plan step 13). Turn prune on in 2 PRs, leaves first. PR A turns prune on in the leaf Applications. After PR A is synced and its checks pass, PR B turns prune on in
clusterandbootstrap. One PR cannot enforce this order. Check before each merge: diff exit code 0 for all 34,requiresPruningequals the baseline, PruneSkipped is 0, and the homelab name set equals the live set. - 5b, homelab (plan step 14). In one homelab PR, write each live patch list as it is into
spec.source.kustomize.patchesof the homelab filesdevops.yaml,ingress.yamlandmattermost.yaml. Copy the lists withjqinto the files, never to output. In the same PR, narrow thedevopsentry ofcluster.yamlto/spec/source/kustomize/images, and remove theingressandmattermostentries. The render does not change, so no Application loses its sync for any period, and no agent patches a live object. A revert is safe, becausekubectl-patchalso owns the live patches. Check: all 34 Applications are Synced with an empty diff, the live patches equal the patches in git,devopsholds the images from Image Updater,IngressServesPlaceholderHostdoes not fire, and no host appears in devops-cli or in a public comment. - 5c, devops-cli (plan step 15).
deploy-stackstops writing the overrides (the goal of feat(k8s): Read homelab config from in-cluster Gitea, drop overrides #1291). Delete theHOMELAB_APPLICATIONSconstants, the override functions,argocd_overrides.py, the 2 gate modules, their tests and the README section. Close feat(k8s): Read homelab config from in-cluster Gitea, drop overrides #1291 as superseded. Check:git grep CONST_K8S_ARGOCD_HOMELAB_APPLICATIONSinsrc/andtests/finds nothing,deploy-stack --dry-runwrites no Application patch, anduv run devops cipasses.
- 5a, homelab (plan step 13). Turn prune on in 2 PRs, leaves first. PR A turns prune on in the leaf Applications. After PR A is synced and its checks pass, PR B turns prune on in
- Delete the environment files, devops-cli (plan step 17). Do this after 7 days with no revert, after the refactor(k8s): read the environment tree from the infra repo #5131 fixture PR and after feat(k8s): run the environment checks in homelab CI #5296 (homelab environment checks, plan step 16). Delete the 130 environment files, the devops overlay, the environment Renovate managers, the environment tests, gate modules and fixtures, and the freeze check. Scope
image-pins.ymltok8s/devops/**; do not delete it. Re-point the 52 OpenSpec specs. Check live that no devops-cli git source names a deleted path: the Application sources list onlyk8s/devopsandk8s/devops/monitoring.git grepfinds no environment file,uv run devops cipasses, and all 34 Applications stay Synced.
Revert of the switch. Compare the Application name sets first. Then run bootstrap-gitops from a devops-cli main checkout, with prune: false if the sets differ. The patches and the digests stay, because kubectl-patch and Image Updater also own them (managedFields). This works until step 6.
Risks. 31 of 34 Applications carry resources-finalizer, so keep prune off on bootstrap and cluster until PR B of step 5a, and change no Application name from S until then. One credential serves all homelab sources, Argo CD itself included: if it fails, every Application shows a comparison error, and nothing syncs or prunes. Public evidence holds exit codes and counts only, because the live objects hold the real hosts.
The deploy notification reads .app.spec.source.repoURL, so deploy statuses go to homelab commits after the switch. #1082 (Gitea mirrors) later mirrors the homelab repo. A pull mirror of a private repo needs a credential, which the owner gives later, outside this cutover.
Owner decisions (2026-11-13). The owner accepted the recommended owner steps:
- Repository credential: the existing GitHub App
devops-cli-argocd(Contents: read), installed on homelab, with an Argo CD repository credential object that the owner creates. No deploy key. Owner step, before step 3. - The owner installs
devops-cli-argocd(Deployments: write) on homelab before step 3. - homelab is the development environment. It keeps the branch and pull request conventions and gets a
.pre-commit-config.yamlwith the pre-commit-hooks hookno-commit-to-branch(branchmain). It gets no branch protection, no ruleset, no required check and no other gate that blocks or delays work. The environment checks of feat(k8s): run the environment checks in homelab CI #5296 are advisory: they report on each pull request and never block a merge or an apply. The freeze check of plan step 12 applies only to the old environment paths in devops-cli. - Actions minutes: path filters on each homelab workflow. Renovate makes the version bumps, so no workflow runs at each devops-cli release. Measure the minutes after one month.
- The switch (step 3) waits for the owner's go. The agent asks when plan steps 1 to 10 pass their checks.
- The owner merges the PRs in both repositories.
- The Gitea pull-mirror credential comes later, outside this cutover.
Target Subsystem
Kubernetes & Minikube Automation
Existing Tool Considered
Argo CD app-of-apps, AppProject sourceRepos, repository credentials and argocd app diff. Cost: about 3M tokens to build, 0.2M a quarter to keep, 5 hours plus 1 hour of the owner.
Acceptance Criteria
- A runbook in
docs/gives each step, the check after it and the revert. - Live, recorded in a PR comment with exit codes and counts only: after step 3 every Application is Synced and Healthy,
argocd app diff --core --exit-codeis 0 for all 34, and no resource was deleted (0 pruned and 0 PruneSkipped results). - After step 5, no field of an Application differs from git, except
spec.source.kustomize.imagesondevops. The patches ofdevops,ingressandmattermostare in the homelab files, andcluster.yamlkeeps only the/spec/source/kustomize/imagesentry ofdevops. - After step 6,
git grepin devops-cli finds no environment file of the list in design section 10, and no live git source of devops-cli names a deleted path.
Dependencies
Owner: step 1 (the repository credential and both App installations). dan-petty/homelab#23 (plan step 9). #5294 released in vX, before step 3. #5295 with step 2. #5296 and the #5131 fixture PR, before step 6. #5135 comes after this item.
Alternatives check of 2026-11-22: in-use.
The repository already uses this tool.
Tool: argoproj/argo-cd (https://github.com/argoproj/argo-cd), Apache-2.0, last activity 2026-11-22, maintained.
Reason: Searches returned only general Argo CD material, but the issue already runs Argo CD: its repository credentials, per-project sourceRepos and app-of-apps cover pointing every Application at the private homelab repo. The rest is cutover work, not a missing tool.
Covers:
- Repository credentials by URL, with GitHub App fields and no deploy key
- AppProject sourceRepos allow-list that names several repositories at once
- App-of-apps bootstrap and cluster Applications syncing from another repository
- argocd app diff --core --exit-code as the post-switch check
- Prune off per Application and ignoreDifferences for live patches
Lacks:
- Credential object and App installation stay owner steps outside git
- Private values must still be written into the homelab files
- deploy-stack keeps patching live Applications until step 5c
- No pull mirror of the private repo until a later credential
- Copy of the environment and runbook remain manual steps
Activity
dan-petty commentedon Nov 12, 2026
Both move private config to a private repo and drop deploy-time overrides, but the candidate sources from dan-petty/homelab and #1291 sources from Gitea.refactor(k8s): read the environment tree from the infra repo (#5334)
dan-petty commentedon Nov 13, 2026
Step 1 (plan step 7) is done (2026-11-13 03:45Z). The owner gave the GitHub App devops-cli-argocd Contents: read (Deployments: write kept); its installation covers all repositories of the account, with the same installation ID as the Argo CD notifications, so the notifications Secret does not change. The owner created the Argo CD repository credential repo-homelab in namespace argocd (type git, the homelab URL, the App ID and key from the notifications Secret).
argocd repo list --core --refresh hardshows the homelab repository as Successful. The orphanedResources ignore entry for this Secret ships with the homelab copy (homelab#23).feat(argocd): admit the homelab repo in both AppProjects (#5365)
devops-cli-service commentedon Nov 16, 2026
Alternatives check: in-use
Reason: Argo CD natively provides every feature the issue needs: app-of-apps (bootstrap → cluster → children), AppProject sourceRepos for multiple repositories, repository credentials including GitHub App authentication, argocd app diff for verification, prune management, self-heal, and kustomize patches with ignoreDifferences. The issue already names Argo CD as its existing tool in the title, body, and the "Existing Tool Considered" section.
The repository already uses this tool.
Tool: argoproj/argo-cd (https://github.com/argoproj/argo-cd)
Covers:
Tools considered:
Searches run:
Sources:
Checked on 2026-11-16. A person decides what this means for the item. The check changes no label and closes no issue.
8 remaining items
build(k8s): record product release pin policy in ADR 0040 (#7165)
dan-petty commentedon Nov 25, 2026
Step 12 of
docs/HOMELAB_REPO_SWITCH.md(freeze and soak), checked on 2026-11-25. #6823 (the freeze check, the Renovate rule and the GitOps text) merged on 2026-11-23 at 02:05 UTC; the soak had more than 1 day and several devops-cli releases.devopshas 49 deployments on devops-cli commits.agents,ingress,loggingandotellast synced before the switch, so they have no new deployment.spec.source.kustomize.imagesondevopschanged (service, runner and mcp-server).danielpetty-com(ApplicationSetservice-workloads, created 2026-11-23 13:58) cannot read the private site repository, because the credential template of dan-petty/homelab#80 does not exist yet. This comes from the new service Application, not from the switch (dan-petty/homelab#131).So step 12 passes, except for that one error, which a person step fixes. The next step is step 13 (prune on, leaves first, two homelab pull requests).
dan-petty commentedon Nov 25, 2026
Step 13 waits: since dan-petty/homelab#145 (Argo CD built from the infra values), shared check 3 gives 12 objects on
argocd, not the 3 of the baseline. 11 of them are safe to prune (dex server, redis secret init, the cluster-wide RBAC of the notifications controller). Secretargocd-notifications-secretis not: it holds the GitHub App credentials of the deploy notifications, and a prune would delete it. dan-petty/homelab#219 keeps it out of the prune; after that, step 13 starts with the new baseline of 11.dan-petty commentedon Nov 25, 2026
Step 13 preparation, 2026-11-25, after dan-petty/homelab#220 merged.
dan-petty/homelab#219 is done.
argocd-notifications-secretis Synced, not marked for prune, and keeps its 4 keys.argocdmarks 11 objects.The baseline of shared check 3 changed. Since the homelab services build from the infra values, 68 objects in 9 Applications are marked for prune, not only objects of
argocd. None is a PersistentVolumeClaim, Namespace, CustomResourceDefinition or CloudNativePG Cluster.argo-workflowsargocddcgm-exporterdevopsgiteagrafanallmprometheuspyroscopeWhat was checked:
gitea: PostgreSQL HA and Valkey cluster objects. The running Gitea usessqlite3. The claims of the StatefulSets stay after the prune.prometheus: node-exporter, kube-state-metrics and Pushgateway areenabled: falsein homelab. Thek8s-monitoringexporters give the scraped series, and no metric comes from a Pushgateway.pyroscope: its own Alloy. The infra values turn it off, andk8s-monitoring-alloy-profilesruns.grafana: no workload reads Secretmonitoring/grafana.dcgm-exporter: no pod mounts the old ConfigMap.Recommendation for step 13. Set
Prune=confirminspec.syncPolicy.syncOptionsof each Application in the same pull request that setsprune: true(Argo CD sync options). A person then approves each prune. Without it, an automerged infra bump that drops or renames an object deletes it with no review. The objects above came from renders that were wrong for a short time.Step 13 waits for the owner to accept this list and the recommendation.
dan-petty commentedon Nov 25, 2026
Step 13, 2026-11-25. The owner accepted the list of the comment above and the
Prune=confirmrecommendation.Pull request A (dan-petty/homelab#228) is merged and synced: each child Application of
clusterprunes withPrune=confirm.argo-workflows,argocd,devops,llm) were checked before the approval.argocd, which Argo CD creates at each sync and never prunes.Pull request B (dan-petty/homelab#233) turns prune on in
clusterandbootstrap, which mark no object. #7245 corrects the text of step 13.Checks before B: the diff check exits 0 for 40 Applications and 1 for
k8s-monitoring. Its sync has waited since 2026-11-24 for a DaemonSet that cannot be healthy while one node is unreachable. It has no object to prune. A person needs to look at that node.docs: give the prune approval of switch step 13 (#7245)
dan-petty commentedon Nov 25, 2026
Correction to the comment above: the node was not broken. A person shut it down on 2026-11-19 (record on #5143). It is on again, and the
k8s-monitoringsync finished: Synced, and the exporter DaemonSet is 5 of 5 ready.After dan-petty/homelab#233, the diff checks of
base,bootstrap,clusterandk8s-monitoringexit 0.fix(k8s): stop deploying gpu-feature-discovery, which labels nothing (#…
dan-petty commentedon Nov 25, 2026
Progress on 2026-11-25:
devops,ingressandmattermostin their files. Each whole spec equals the live spec except the image digest. It waits for its merge.refactor(k8s): delete the deploy-time host overrides of Argo CD (#7258)
dan-petty commentedon Nov 25, 2026
2026-11-25:
IngressServesPlaceholderHostdoes not fire. The one comparison error is the generated site Application, which has no repository credential yet.dan-petty commentedon Nov 26, 2026
2026-11-26: the owner started step 17 and waived its condition of 7 days with no revert. The item is #7290. Shared checks before the work: 40 of 40 diffs exit 0, 0 comparison errors, 0 firing placeholder alerts, 0 paused Applications, and the devops-cli paths of check 7 are in the product folder only.