mirror of
https://github.com/cozystack/cozystack.git
synced 2026-12-05 14:42:05 +09:00
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 <auricx.business@gmail.com>
This commit is contained in:
1 parent
9af6594342
commit
5a0ee76edf
3 files changed
+26
-1
No files matched your search
@@ -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 .
|
||||
@@ -33,7 +33,6 @@ spec:
|
||||
name: {{ .Values.provider | quote }}
|
||||
sources:
|
||||
- ingress
|
||||
- service
|
||||
{{- if .Values.gatewayAPI }}
|
||||
- gateway-httproute
|
||||
- gateway-tlsroute
|
||||
|
||||
@@ -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]
|
||||
Reference in new issue
Block a user