From 088bd7b7bbb9020fd2db104f2d90e8f9c5117c2d Mon Sep 17 00:00:00 2001 From: Konstantin Renner Date: Tue, 5 May 2026 21:51:11 +0200 Subject: [PATCH] flux(home-assistant): close cross-KS Secret race + relocate ServiceMonitor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit matter-server's seed initContainer mounts garage-migration-creds, owned by the home-assistant Kustomization. Without an explicit dependsOn the init container CreateContainerConfigError-loops on a fresh rebuild while HA is still gated upstream — observed during the 2026-05-05 cold start. home-assistant's ServiceMonitor consumes a CRD installed by the kube-prometheus-stack chart (monitoring KS), so applying it from the HA KS races the CRD on first reconcile. Move it under monitoring-rules, which already exists for monitoring.coreos.com/* resources after the chart lands its CRDs. Co-Authored-By: Claude Opus 4.7 (1M context) --- kubernetes/apps/home-assistant/kustomization.yaml | 1 - .../home-assistant-servicemonitor.yaml} | 0 kubernetes/apps/monitoring-rules/kustomization.yaml | 1 + kubernetes/clusters/homelab/home-assistant.yaml | 4 ++++ 4 files changed, 5 insertions(+), 1 deletion(-) rename kubernetes/apps/{home-assistant/servicemonitor.yaml => monitoring-rules/home-assistant-servicemonitor.yaml} (100%) diff --git a/kubernetes/apps/home-assistant/kustomization.yaml b/kubernetes/apps/home-assistant/kustomization.yaml index 47245ad4..8f8e6c63 100644 --- a/kubernetes/apps/home-assistant/kustomization.yaml +++ b/kubernetes/apps/home-assistant/kustomization.yaml @@ -8,7 +8,6 @@ resources: - service.yaml - iot-service.yaml - ingress.yaml - - servicemonitor.yaml - prometheus-token.sops.yaml - rbac.yaml - mosquitto-bootstrap.yaml diff --git a/kubernetes/apps/home-assistant/servicemonitor.yaml b/kubernetes/apps/monitoring-rules/home-assistant-servicemonitor.yaml similarity index 100% rename from kubernetes/apps/home-assistant/servicemonitor.yaml rename to kubernetes/apps/monitoring-rules/home-assistant-servicemonitor.yaml diff --git a/kubernetes/apps/monitoring-rules/kustomization.yaml b/kubernetes/apps/monitoring-rules/kustomization.yaml index 72d9dea9..5958d235 100644 --- a/kubernetes/apps/monitoring-rules/kustomization.yaml +++ b/kubernetes/apps/monitoring-rules/kustomization.yaml @@ -5,3 +5,4 @@ kind: Kustomization # only after `monitoring` is Ready (chart installed → CRDs present). resources: - prometheusrule-garage.yaml + - home-assistant-servicemonitor.yaml diff --git a/kubernetes/clusters/homelab/home-assistant.yaml b/kubernetes/clusters/homelab/home-assistant.yaml index 39044671..903a90b2 100644 --- a/kubernetes/clusters/homelab/home-assistant.yaml +++ b/kubernetes/clusters/homelab/home-assistant.yaml @@ -76,6 +76,10 @@ spec: - name: infrastructure - name: infrastructure-crds - name: infrastructure-ceph-cluster + # The seed initContainer mounts `garage-migration-creds`, which is owned + # by the home-assistant Kustomization. Without this dependency the init + # container CreateContainerConfigError-loops until HA's KS lands first. + - name: home-assistant --- apiVersion: kustomize.toolkit.fluxcd.io/v1 kind: Kustomization