Repository navigation
Description
Problem
This repository is public, so since #1290 the homelab's private values reach Argo CD at deploy time rather than through git:
- The hosts are Kustomize patches that
devops k8s deploy-stackwrites onto the Applicationsdevopsandingress; theclusterapp-of-apps ignores them. - ConfigMap
devops-cli-configis rendered fromconfig.yamland is owned by no Application.
That keeps the values out of git, but they then live only in the cluster and in config.yaml:
- Recreating an Application drops its hosts until
deploy-stackruns again. - Argo CD's documentation calls overrides held on the Application "an anti-pattern to GitOps" [sourced: https://argo-cd.readthedocs.io/en/stable/user-guide/parameters/].
- Its best practices recommend a separate configuration repository [sourced: https://argo-cd.readthedocs.io/en/stable/user-guide/best_practices/].
Once the in-cluster Gitea runs (#1081) and Argo CD reads from it (#1082), a private configuration repository there can hold these values. The same forge then serves dynamic environments for project iteration and sandbox testing (owner, 2026-10-07).
Acceptance criteria
- A private repository on the in-cluster Gitea holds the homelab's Argo CD configuration:
- Kustomize overlays that use this repository's
k8s/as a remote base pinned with?ref=; - patches setting the hosts under the homelab domain;
- a
configMapGeneratorfordevops-cli.yaml.
- Kustomize overlays that use this repository's
- The Applications
devopsandingress(and any other Application that needs a homelab value) render from that repository. Argo CD reaches it with a repository Secret thatdevops k8s push-secretscreates from the keyring. -
deploy-stackstops writing Application overrides and the ConfigMap on an Argo CD-managed cluster, and theignoreDifferencesadded tok8s/argocd/bootstrap/cluster.yamlin fix(k8s): argo cd takes homelab values from deploy-time overrides, and the repository holds no private or placeholder config #1290 is removed. The native path keeps rendering the ConfigMap fromconfig.yaml. - A documented cutover moves a running cluster from the deploy-time overrides to the Gitea repository without an Ingress outage.
-
uv run devops cipasses.
Key questions
- Which Gitea repository holds the configuration: a mirror of the private homelab repository, or a dedicated configuration repository? (proposed) A dedicated
homelab-configrepository, so Argo CD's credential reaches nothing else. - How are the overlays kept in step with this repository's releases? (proposed) Pin
?ref=to the release tag and bump it in the same step that bumps the image tag. - Do the dynamic environments for open pull requests (feat(k8s): Point Argo CD to Gitea for git and PR dev images #1082) share this repository? (proposed) No. They get generated Applications that reference it; their scope stays in feat(k8s): Point Argo CD to Gitea for git and PR dev images #1082.
Strategic alignment
- Depends on: feat(k8s): the homelab runs gitea under argo cd as a read-write internal forge, served in-cluster over http and to workstations at https://git.<domain> through the cloudflare tunnel, with its admin secret pushed from the keyring #1081, feat(k8s): Point Argo CD to Gitea for git and PR dev images #1082. Related: fix(k8s): argo cd takes homelab values from deploy-time overrides, and the repository holds no private or placeholder config #1290, feat(repos): Add a gitea remote to every clone under repos/ #1090.
Alternatives check of 2026-11-25: 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-24, maintained.
Reason: Searches found no tool beyond Argo CD, which the project already runs: it renders Applications from a private config repository with a repository Secret, Kustomize remote bases and configMapGenerator. The deploy-stack, push-secrets and cutover work stays in the CLI.
Covers:
- Applications render from a private config repository via a repository Secret
- Kustomize remote base pinned with
?ref=to a release tag - configMapGenerator and host patches held outside the Application spec
Lacks:
- No deploy-stack change; overrides and ConfigMap still written
- No push-secrets row for the Gitea repository Secret
- No cutover procedure that keeps the Ingress available
Proposed design
Problem statement
The public repository cannot hold the homelab's private hosts and CLI ConfigMap. #1290 keeps these values as Argo CD Application overrides and an unowned ConfigMap, so recreating an Application drops them, and Argo CD calls overrides held on the Application an anti-pattern to GitOps. The change moves the values to a dedicated private homelab-config repository on the in-cluster Gitea, has the devops, ingress and mattermost Applications render from it through a repository Secret, and removes the deploy-time overrides while the native path keeps the ConfigMap.
Acceptance criteria
Requirement: Private repository layout
The GitOps section of k8s/README.md SHALL show the private homelab-config repository layout: one Kustomize overlay per homelab Application, each remote base pinned to a release tag with ?ref=v<major>.<minor>.<patch>, the host patches under the homelab domain, and a configMapGenerator for devops-cli.yaml.
Scenario: Document shows the overlay layout
- WHEN A test reads the GitOps section of
k8s/README.md. - THEN The section shows a base URL under
https://github.com/dan-petty/devops-cli//k8s/with?ref=v, a host patch, and aconfigMapGeneratornameddevops-cli-configwithdisableNameSuffixHash: trueand the filedevops-cli.yaml.
Requirement: Applications read from Gitea
The app-of-apps SHALL point the devops, ingress, and mattermost Applications at the private homelab-config repository on the in-cluster Gitea.
Scenario: Applications use the Gitea source
- WHEN A test reads the Application manifests under
k8s/argocd/apps. - THEN Each Application has
spec.source.repoURL: http://gitea-http.gitea.svc.cluster.local:3000/gitea_admin/homelab-config.git,spec.source.targetRevision: main, and aspec.source.paththat names its overlay.
Requirement: Argo CD repository Secret
devops k8s push-secrets SHALL create the Argo CD repository Secret argocd/homelab-config-repo from the keyring.
Scenario: push-secrets creates the repository Secret
- WHEN
devops k8s push-secrets --only argocd/homelab-config-reporuns with the Gitea repository URL and the keyring entrygitea.admin_password. - THEN The Secret has the label
argocd.argoproj.io/secret-type: repository, the repository URL, the usernamegitea_admin, and the password fromgitea.admin_password.
Requirement: Argo CD-managed cluster skips overrides
deploy-stack SHALL write no Application overrides and no devops-cli-config ConfigMap on an Argo CD-managed cluster.
Scenario: Argo CD-managed cluster gets no overrides
- WHEN
deploy-stack --stack devopsruns against a cluster that has Applicationclusterin namespaceargocd. - THEN It sends no
kubectl patch applicationand creates nodevops-cli-configConfigMap.
Requirement: Native path keeps ConfigMap
deploy-stack SHALL keep rendering devops-cli-config from config.yaml on the native path.
Scenario: Native path renders the ConfigMap
- WHEN
deploy-stack --stack devopsruns against a cluster that Argo CD does not manage. - THEN It applies
devops-cli-configrendered fromconfig.yaml.
Requirement: Narrow the kustomize ignore entries
k8s/argocd/bootstrap/cluster.yaml SHALL remove the /spec/source/kustomize ignoreDifferences entries for ingress and mattermost, and SHALL narrow the devops entry to /spec/source/kustomize/images.
Scenario: Cluster app-of-apps ignores only the Image Updater digest
- WHEN A test reads
k8s/argocd/bootstrap/cluster.yaml. - THEN No entry names
ingressormattermostunder/spec/source/kustomize, thedevopsentry lists only/spec/source/kustomize/images, and the finalizerjqPathExpressionsentry remains.
Requirement: Cutover keeps Ingress available
The GitOps section of k8s/README.md SHALL order the cutover so the private source renders the hosts before the deploy-time overrides are removed.
Scenario: Cutover order preserves Ingress
- WHEN A test reads the GitOps section of
k8s/README.md. - THEN The section orders repository creation, repository Secret creation, the merge,
devopsandingresssyncs, the Ingress check, and the removal of the oldspec.source.kustomizepatches last, keepingspec.source.kustomize.imagesondevops.
Requirement: CI passes
The change SHALL pass uv run devops ci.
Scenario: CI passes
- WHEN
uv run devops ciruns on the change. - THEN The command exits with status 0.
Existing Tool Considered
Argo CD covers the GitOps sync and the repository Secret (https://argo-cd.readthedocs.io/en/stable/user-guide/best_practices/). Gitea covers the private repository, served in-cluster at http://gitea-http.gitea.svc.cluster.local:3000 (k8s/README.md:965). Neither renders the overlays from this repository's k8s/ nor removes the deploy-time overrides; the change extends the existing devops CLI (push-secrets and deploy-stack) for those. The alternatives check recorded not-applicable with no tool. The written cost is about 10,000 to 15,000 tokens to build, keep and fix the CLI, manifest, test and document changes, and one to two days.
Key questions
- Which Gitea repository holds the homelab configuration: a mirror of the private homelab repository, or a dedicated configuration repository?: Use a dedicated
homelab-configrepository. Argo CD's best practices recommend a separate configuration repository, and the repository Secret then reaches only that repository. (proposed)- Chosen: Dedicated
homelab-configrepository. It separates config from source and limits the Argo CD credential to the configuration repository. - Rejected: Mirror of the private homelab repository. The credential and Argo CD would reach the whole private homelab repository, and its history would mix source and configuration.
- Chosen: Dedicated
- How are the overlays kept in step with this repository's releases?: Pin each remote base to the release tag with
?ref=v<major>.<minor>.<patch>. Bump the pin in the private repository after release-please publishes the tag; the image digest moves independently through Argo CD Image Updater, so the bump is not the image-tag step. (best practice) [sources: docs/adr/0013-releases-use-release-please-as-it-ships-and-agents-stay-out.md:11, docs/adr/0013-releases-use-release-please-as-it-ships-and-agents-stay-out.md:19, k8s/argocd/image-updater-values.yaml:5]- Chosen: Pin to the release tag. Argo CD's best practices require a tag or commit SHA for a remote base, and a release tag names a release that release-please creates.
- Rejected: Pin to a commit SHA. A commit SHA is also stable, but it names no release and needs a lookup after each release.
- Rejected: Track
main. A remote base to a moving branch changes meaning without a change in the private repository; Argo CD's best practices call this out. - Rejected: Use no pin. The remote base resolves HEAD, the least stable option.
- Do the dynamic environments for open pull requests (feat(k8s): Point Argo CD to Gitea for git and PR dev images #1082) share this repository?: No. The generated Applications for open pull requests stay in feat(k8s): Point Argo CD to Gitea for git and PR dev images #1082; they do not share the
homelab-configrepository. (best practice) [sources: k8s/argocd/values.yaml:187]- Chosen: Separate generated Applications. The homelab configuration repository keeps one purpose and one credential scope.
- Rejected: Share the homelab configuration repository. Generated environments would mix with homelab values and the repository Secret.
- Which Applications need a homelab value today?:
devops,ingress, andmattermost. [sources: src/devops_cli/config/constants.py:1131, k8s/argocd/bootstrap/cluster.yaml:29] - Which
ignoreDifferencesentries incluster.yamldoes the change remove?: Remove theingressandmattermost/spec/source/kustomizeentries. Narrow thedevopsentry to/spec/source/kustomize/images, because Argo CD Image Updater writes the Service digest there and the cluster app-of-apps must keep ignoring it. Keep the finalizerjqPathExpressionsentry. (best practice) [sources: k8s/argocd/bootstrap/cluster.yaml:29, k8s/argocd/image-updater-values.yaml:5, k8s/README.md:1181, tests/invariants/test_k8s_argocd_apps.py:466]- Chosen: Narrow
devopsto images and removeingressandmattermost. The host patches leave git, but Image Updater still writesspec.source.kustomize.imagesondevops. - Rejected: Remove all three entries. The
devopsdiff would show Image Updater's digest and the app-of-apps would keep reporting OutOfSync. - Rejected: Keep all three entries. The host patches no longer exist, so the ignores hide a future override and keep the anti-pattern.
- Chosen: Narrow
- What does
deploy-stackdo on an Argo CD-managed cluster?: It writes no Application overrides and creates nodevops-cli-configConfigMap; the private repository'sconfigMapGeneratorowns the ConfigMap. The native path still renders the ConfigMap fromconfig.yaml. (best practice) [sources: src/devops_cli/commands/k8s/stack_lifecycle.py:1217, src/devops_cli/commands/k8s/stack_lifecycle.py:1416, src/devops_cli/commands/k8s/stack_lifecycle.py:1458, src/devops_cli/k8s/configmap.py:125]- Chosen: Skip overrides and ConfigMap on Argo CD-managed clusters. Argo CD owns the Application source, and the private repository owns the values.
- Rejected: Keep writing overrides. Argo CD calls this an anti-pattern, and a recreated Application loses the values.
- Rejected: Skip the ConfigMap on every cluster. The native path has no other source for
devops-cli.yaml.
- What is the cutover order that avoids an Ingress outage?: Create the private repository and the repository Secret first, then merge the change. Wait for
devopsandingressto sync from the private source, check the Ingress, and remove the oldspec.source.kustomizepatches last, keepingspec.source.kustomize.imagesondevops. (best practice) [sources: k8s/README.md:1145, k8s/argocd/bootstrap/cluster.yaml:29]- Chosen: Repository and Secret before merge, remove the old patches last. The private source renders the hosts before the old patches go, so the Ingress never loses its host.
- Rejected: Remove the old overrides first. A sync without the private source or the old patches drops the hosts and breaks the Ingress.
- Rejected: Merge before the repository Secret. The Applications cannot render the private source until Argo CD has the credential.
- Which keyring entry and stack does the Argo CD repository Secret use?: The Secret is
argocd/homelab-config-repoin stackinfra, withusernamegitea_adminandpasswordfromgitea.admin_password. (best practice) [sources: docs/ENV_VARS.md:88, src/devops_cli/k8s/cluster_secrets.py:514, src/devops_cli/k8s/cluster_secrets.py:488]- Chosen: Reuse
gitea.admin_password. It is the existing Gitea credential, and the repository Secret is scoped to thehomelab-configURL. - Rejected: Add a read-only Gitea token. It adds a credential and a manual token creation that no command does today; it is a follow-up when Gitea token provisioning exists.
- Chosen: Reuse
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsReady
- StatusShow more project fieldsNew
Activity
dan-petty-bot commentedon Oct 7, 2026
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.
The current deploy-time override workaround functions but is an acknowledged anti-pattern; the change is strategically important yet blocked on #1081 and #1082 and has no active outage.It restores a proper GitOps flow, makes Application recreation safe, and aligns with Argo CD best practices, but the existing workaround still works today.Requires a dedicated Gitea repo, Kustomize overlays with pinned refs, a repository Secret, deploy-stack changes, a documented cutover, and removal of the #1290 overrides, but each piece is well-scoped.fix(k8s): a manual sync of the app-of-apps drops the homelab host ove…
dan-petty commentedon Oct 26, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones on the board.
The change improves GitOps practices and cluster management but is not critical or urgent.Improves cluster stability, avoids anti-patterns, and aligns with Argo CD best practices.Requires setting up a new repository, updating configurations, and managing secrets.Both items involve Argo CD pointing to Gitea, but the candidate focuses on reading private configuration while item 1082 covers general git and container registry access for development versions.dan-petty commentedon Oct 28, 2026
Status set to Ready at 69636b6 (see proposed design in issue body).
dan-petty commentedon Oct 28, 2026
This item cannot be built as written. Its goal stays valid: the homelab's hosts and
devops-cli-configleave the hand-set overrides on the Applications, so a manual sync or a recreated Application no longer drops them (#2195). But the mechanism that the item specifies does not work with how the cluster deploys now, and its prerequisites are not in place. No code was written.Evidence (origin/main and the live cluster, 2026-10-28; Argo CD v3.5.3)
?ref=pin conflicts with ADR 0013. The overlays use this repository'sk8s/as a remote base pinned with?ref=, and the proposed answer pins it "to the release tag and bump[s] it in the same step that bumps the image tag". ADR 0013 (2026-10-23) says: "Because Argo CD tracksmain, a tag deploys nothing", and it deletes the release path. No step bumps an image tag now: Image Updater follows the digest ofservice:latestby itself (k8s/argocd/image-updater-values.yaml). A release-tag pin would holddevopsandingressat the last release, while the other 26 Applications trackmain.mainmakesdevopsandingressdeploy late. Argo CD "aggressively caches generated manifests and uses the repository commit SHA as a cache key", for 24 h by default, and "with Kustomize remote bases ... the expected manifests can change even though the repo has not changed" (https://argo-cd.readthedocs.io/en/stable/operator-manual/high_availability/). The cache key would be the commit of the Gitea repository, so a change tok8s/overlays/homelab/on GitHubmainreaches the cluster only when that cache expires. A multi-source Application does not help: itsrefis documented for HelmvalueFilesonly (https://argo-cd.readthedocs.io/en/stable/user-guide/multiple_sources/).devops. Image Updater writesspec.source.kustomize.imageson the livedevopsApplication (its write-back target). TheignoreDifferencesentry andServerSideApply=trueondevopsmust stay for that field, whatever holds the hosts.argocdhas the labelargocd.argoproj.io/secret-type.k8s/argocd/networkpolicy.yamlhas no egress to Gitea.local-pathvolume, and feat(k8s): Add scheduled off-node backup and restore for Gitea #2144 (its backup) is open. The values stay recoverable, becauseconfig.yamlstays their source.Proposed re-scope
main. The ApplicationsdevopsandingresskeeprepoURLGitHub,targetRevision: main, so ADR 0013 holds and nothing deploys late.homelab-configrepository on Gitea.templatePatch(withgoTemplate: true) writes the host patches intospec.source.kustomize.patchesof the generateddevopsandingressApplications.ignoreApplicationDifferencesleaves/spec/source/kustomize/imagesto Image Updater (https://argo-cd.readthedocs.io/en/stable/operator-manual/applicationset/Template/, https://argo-cd.readthedocs.io/en/stable/operator-manual/applicationset/Controlling-Resource-Modification/). The values come from git, not from hand-set overrides, and a recreated Application gets them again from the generator.devops-cli-configin the same Gitea repository, synced by a small Application with no remote base, so its content has no cache lag.devops k8srenders the values file and the ConfigMap fromconfig.yamland pushes them to Gitea, with--dry-run,--planand--confirm.deploy-stackthen stops writing the overrides and the ConfigMap on a cluster that Argo CD manages.replicas: 0on purpose (k8s/argocd/values.yaml, fix(argocd): argo cd syncs the argocd namespace perimeter, and the unused applicationset controller runs no replicas #1673), and feat(k8s): Point Argo CD to Gitea for git and PR dev images #1082 turns it on. The part of feat(k8s): Point Argo CD to Gitea for git and PR dev images #1082 that turns on the controller and adds the Gitea read credential and the egress rule lands first, then this item.mainand shortenreposerver.repo.cache.expiration. The HA page suggests 1 h for low-volume environments. This accepts up to that lag fordevopsandingress, and it regenerates the manifests of every Application more often.devops-cli-service commentedon Oct 29, 2026
Refine cannot set this item to Ready at a408dee until a person answers the questions below. Reply in a comment or edit the body, and the next refine round looks at the item again.
devops-cli-service commentedon Oct 29, 2026
Alternatives check: not-applicable
Tool: none found
Checked on 2026-10-29. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 5, 2026
Refine cannot set this item to Ready at 502219a until a person answers the questions below. Reply in a comment or edit the body, and the next refine round looks at the item again.
[-]feat(k8s): argo cd reads the homelab's private configuration from the in-cluster gitea, and the deploy-time application overrides retire[/-][+]feat(k8s): Read homelab config from in-cluster Gitea, drop overrides[/+]dan-petty commentedon Nov 6, 2026
The job shortened the title of this item. The summary had 125 characters, and the limit is 60. The type and the scope stay.
feat(k8s): argo cd reads the homelab's private configuration from the in-cluster gitea, and the deploy-time application overrides retirefeat(k8s): Read homelab config from in-cluster Gitea, drop overridesdevops-cli-service commentedon Nov 12, 2026
Refine cannot set this item to Ready at 87ae9ee while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.
The next refine round also looks at the item again when a commit on the default branch changes one of these files:
k8s/argocd/networkpolicy.yaml.dan-petty commentedon Nov 12, 2026
Superseded by #5134. The owner decided on 2026-11-12: "once infra environment repo management is supported, we can move homelab configuration artifacts to that repo and update argocd config". dan-petty/homelab is private, so it holds the private values in git, and #5134 keeps the goal of this item: Argo CD reads the homelab configuration from a private repository,
deploy-stackstops writing the overrides, and theignoreDifferencesof #1290 goes away. The Gitea config repository is no longer the plan; #1082 can later mirror dan-petty/homelab. Tracker: #5120. This item stays open for a person to close.devops-cli-service commentedon Nov 18, 2026
The result in the alternatives block of the issue body changed. Before this check:
not-applicable, no tool. A person decides what the new result means for the item.Searches (6)
Tools considered:
Searches run:
Sources:
dan-petty commentedon Nov 25, 2026
Superseded by step 14 and step 15 of #5134. The private repository is dan-petty/homelab on GitHub, not on the in-cluster Gitea. Its Application files hold the hosts (dan-petty/homelab#242), and
deploy-stackwrites no override (#7258).One criterion of this item is not covered:
deploy-stackstill renders ConfigMapdevops-cli-configand its sandbox copy fromconfig.yaml, and no Application owns them. File that as its own item if the homelab repository should render them.