From 5a0ee76edf6dffd2672e3ee5e683129c211ea1cc Mon Sep 17 00:00:00 2001 From: AuricX Date: Fri, 27 Nov 2026 09:22:54 +0200 Subject: [PATCH] fix(external-dns): stop enabling the service source on tenant instances An ExternalDNS application crash-loops a minute after every start and publishes no records: level=fatal msg="failed to sync *v1.Node: context deadline exceeded with timeout 1m0s" The instance runs external-dns namespaced, so the vendored chart renders a Role and leaves out the nodes rule, because a Role cannot grant a cluster-scoped resource. The service source still starts a Node informer, which never syncs without that grant. Drop service from the hardcoded sources rather than grant nodes through a ClusterRole. The source only publishes Services that carry the external-dns hostname annotation, and tenants cannot annotate the Services the platform renders in their namespace, so it published nothing here. A ClusterRole would be cluster-scoped RBAC created by a tenant application for a source with no use. Tested with a new helm-unittest suite that pins the rendered sources with and without gatewayAPI. Both cases fail while service is listed. Closes: #4958 Assisted-by: LLM Signed-off-by: AuricX --- packages/extra/external-dns/Makefile | 3 +++ .../external-dns/templates/external-dns.yaml | 1 - .../external-dns/tests/sources_test.yaml | 23 +++++++++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 packages/extra/external-dns/tests/sources_test.yaml diff --git a/packages/extra/external-dns/Makefile b/packages/extra/external-dns/Makefile index 8b8fbc2f9..e6d2e8da4 100644 --- a/packages/extra/external-dns/Makefile +++ b/packages/extra/external-dns/Makefile @@ -5,3 +5,6 @@ include ../../../hack/package.mk generate: cozyvalues-gen -v values.yaml -s values.schema.json -r README.md ../../../hack/update-crd.sh + +test: + helm unittest . diff --git a/packages/extra/external-dns/templates/external-dns.yaml b/packages/extra/external-dns/templates/external-dns.yaml index 29780d508..b863083ca 100644 --- a/packages/extra/external-dns/templates/external-dns.yaml +++ b/packages/extra/external-dns/templates/external-dns.yaml @@ -33,7 +33,6 @@ spec: name: {{ .Values.provider | quote }} sources: - ingress - - service {{- if .Values.gatewayAPI }} - gateway-httproute - gateway-tlsroute diff --git a/packages/extra/external-dns/tests/sources_test.yaml b/packages/extra/external-dns/tests/sources_test.yaml new file mode 100644 index 000000000..4d459eec6 --- /dev/null +++ b/packages/extra/external-dns/tests/sources_test.yaml @@ -0,0 +1,23 @@ +suite: external-dns rendered sources +templates: + - templates/external-dns.yaml + +set: + provider: inmemory + +tests: + # The default source must not start a Node informer: the namespaced Role + # cannot grant access to nodes. + - it: enables only the ingress source by default + asserts: + - equal: + path: spec.values.external-dns.sources + value: [ingress] + + - it: adds the Gateway API route sources when gatewayAPI is on + set: + gatewayAPI: true + asserts: + - equal: + path: spec.values.external-dns.sources + value: [ingress, gateway-httproute, gateway-tlsroute]