Skip to content

fix(k8s): a manual sync of the app-of-apps drops the homelab host overrides and every public hostname returns 404 - #2195

Merged
dan-petty merged 1 commit into
mainfrom
fix/1817-manual-sync-keeps-host-overrides
Oct 24, 2026
Merged

dan-petty merged 1 commit into
mainfrom
fix/1817-manual-sync-keeps-host-overrides

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

Summary

On 2026-10-21, a manual sync of 17 Applications from the Argo CD UI, among them cluster, deleted the host overrides in spec.source.kustomize of the Applications ingress and devops. Argo CD then rendered the placeholder hosts of git, and every public host returned 404 until devops k8s deploy-stack set the overrides again.

Cause, from Argo CD v3.5.3 (the live version) and read-only commands on the cluster:

  • cluster applied the two Applications client-side. Client-side apply deletes each field that the last-applied-configuration annotation holds and git does not (Argo CD sync-options documentation). The RespectIgnoreDifferences=true option of cluster copies the live overrides into the applied manifest, so the live annotation of both Applications holds spec.source.kustomize.
  • The controller reads that option only from the sync operation (controller/sync.go). A manual sync takes the options of the request, and the options of the spec only when the request has none (server/application/application.go). So a manual sync can omit the option, and no Argo CD setting adds it.
  • kubectl diff --field-manager=argocd-controller (a server-side dry run, which writes nothing) of the two manifests as git holds them shows the deletion of spec.source.kustomize on both.

Fix:

  • k8s/argocd/apps/ingress.yaml and devops.yaml get the annotation argocd.argoproj.io/sync-options: ServerSideApply=true. gitops-engine reads it in every sync, whatever the options of the operation are (shouldUseServerSideApply). Server-side apply deletes only the fields of its own field manager. The live managed fields give the patches to kubectl-patch (deploy-stack) and the image digest to Image Updater. kubectl diff --server-side --force-conflicts --field-manager=argocd-controller with the annotation shows only the new annotation, and spec.source.kustomize stays.
  • k8s/argocd/bootstrap/cluster.yaml gets argocd.argoproj.io/client-side-apply-migration-manager: argocd-controller. The client-side apply of Argo CD writes the managed field entry argocd-controller (operation Update), not the default migration manager kubectl-client-side-apply. With the annotation, the first server-side sync moves the fields of that entry to the server-side apply entry, so a field that git removes from the two Applications also leaves the cluster.
  • The check that rule 11 asks for: the critical alert IngressServesPlaceholderHost (5m) fires for each Ingress that routes a host under the placeholder domain, from kube_ingress_path. The kube-state-metrics includeMetrics now keeps that series, because the default allow list of the chart drops it. The alert only reads.
  • k8s/README.md (GitOps, Homelab Values at Deploy Time) tells why a sync keeps the overrides, which actions still remove them (a recreated Application, a Replace sync without Respect Ignore Differences), the alert, and the commands that set them again. It names feat(k8s): Read homelab config from in-cluster Gitea, drop overrides #1291, which moves the values out of the Applications to a private repository on the in-cluster Gitea after feat(k8s): Point Argo CD to Gitea for git and PR dev images #1082.

Tests: tests/test_k8s_argocd_apps.py pins the annotations. tests/test_k8s_monitoring_alerting.py pins the rule and its series, and checks its host pattern against every Ingress host in git. The tests read files only. devops ci fail-to-pass --base origin/main shows the four new or changed tests fail on the base.

Item

Closes #1817

Change: openspec/changes/archive/2026-10-24-1817-manual-sync-keeps-host-overrides/

…rrides and every public hostname returns 404

The app-of-apps `cluster` applied the Applications `devops` and `ingress`
client-side. Client-side apply deletes each field that the last-applied
annotation holds and git does not, and `RespectIgnoreDifferences=true`
writes the host overrides into that annotation. A manual sync can omit
that option, so the sync of 2026-10-21 deleted the overrides.

- The two Applications have the annotation
  `argocd.argoproj.io/sync-options: ServerSideApply=true`. Argo CD reads
  it in every sync, automated or by hand. Server-side apply keeps the
  fields that deploy-stack and Image Updater own.
- `cluster` names `argocd-controller` as its client-side apply migration
  manager, so a field that git removes from the two Applications also
  leaves the cluster.
- The critical alert `IngressServesPlaceholderHost` fires when an Ingress
  routes a host under the placeholder domain, from `kube_ingress_path`,
  which the kube-state-metrics allow list now keeps.
- k8s/README.md tells which actions still remove the overrides, the alert
  and the commands that set them again, and names #1291.

Closes #1817
@dan-petty
dan-petty marked this pull request as ready for review October 24, 2026 22:48
@dan-petty
dan-petty merged commit 7c97467 into main Oct 24, 2026
17 checks passed
@dan-petty
dan-petty deleted the fix/1817-manual-sync-keeps-host-overrides branch October 24, 2026 22:48
dan-petty pushed a commit that referenced this pull request Oct 24, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.4.3](v0.4.2...v0.4.3)
(2026-10-24)


### Bug Fixes

* **k8s:** a manual sync of the app-of-apps drops the homelab host
overrides and every public hostname returns 404
([#2195](#2195))
([7c97467](7c97467))
* **review:** the review pipeline reports the eight failures it now
swallows, and reads a file in one place
([#2196](#2196))
([da401c6](da401c6)),
closes [#2160](#2160)

---
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(k8s): a manual sync of the app-of-apps drops the homelab host overrides and every public hostname returns 404

1 participant