Skip to content

Commit d8f5083

Browse files
authored
fix(monitoring-agents): use global.clusterDomain for FQDN resolution (#2086)
## What this PR does PR #2075 introduced `_cluster.cluster-domain` references in monitoring-agents `values.yaml` for FQDN resolution in tenant clusters. This broke the fluent-bit subchart because `_cluster` values are not accessible from the Helm subchart context — only `global` values are shared with subcharts. This PR replaces `_cluster` references with a new `global.clusterDomain` variable: - Empty by default (management cluster uses short DNS names like `service.namespace.svc`) - Set to the management cluster domain (e.g. `cozy.local`) for tenant clusters, enabling FQDN resolution for cross-cluster service discovery Fixes #2084 ### Release note ```release-note [system] Fix monitoring-agents installation failure caused by inaccessible _cluster values in fluent-bit subchart context. Introduce global.clusterDomain for proper FQDN resolution in tenant workload clusters. ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Monitoring agent configuration updated to support configurable cluster domain names for greater flexibility. * Remote write and log-forwarding endpoints adjusted to align with cluster domain handling, improving compatibility when deploying across different cluster DNS setups. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2 parents 1fd1da4 + d8bb352 commit d8f5083

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

‎packages/apps/kubernetes/templates/helmreleases/monitoring-agents.yaml‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{{- $targetTenant := .Values._namespace.monitoring }}
2+
{{- $clusterDomain := (index .Values._cluster "cluster-domain") | default "cozy.local" }}
23
{{- if .Values.addons.monitoringAgents.enabled }}
34
apiVersion: helm.toolkit.fluxcd.io/v2
45
kind: HelmRelease
@@ -49,7 +50,7 @@ spec:
4950
cluster: {{ .Release.Name }}
5051
tenant: {{ .Release.Namespace }}
5152
remoteWrite:
52-
url: http://vminsert-shortterm.{{ $targetTenant }}.svc:8480/insert/0/prometheus
53+
url: http://vminsert-shortterm.{{ $targetTenant }}.svc.{{ $clusterDomain }}:8480/insert/0/prometheus
5354
fluent-bit:
5455
readinessProbe:
5556
httpGet:
@@ -72,7 +73,7 @@ spec:
7273
[OUTPUT]
7374
Name http
7475
Match kube.*
75-
Host vlogs-generic.{{ $targetTenant }}.svc
76+
Host vlogs-generic.{{ $targetTenant }}.svc.{{ $clusterDomain }}
7677
port 9428
7778
compress gzip
7879
uri /insert/jsonline?_stream_fields=stream,kubernetes_pod_name,kubernetes_container_name,kubernetes_namespace_name&_msg_field=log&_time_field=date

‎packages/system/monitoring-agents/values.yaml‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,8 @@ vmagent:
280280
cluster: cozystack
281281
remoteWrite:
282282
urls:
283-
- http://vminsert-shortterm.{{ .Values.global.target }}.svc.{{ (index .Values._cluster "cluster-domain") | default "cluster.local" }}:8480/insert/0/prometheus
284-
- http://vminsert-longterm.{{ .Values.global.target }}.svc.{{ (index .Values._cluster "cluster-domain") | default "cluster.local" }}:8480/insert/0/prometheus
283+
- http://vminsert-shortterm.{{ .Values.global.target }}.svc:8480/insert/0/prometheus
284+
- http://vminsert-longterm.{{ .Values.global.target }}.svc:8480/insert/0/prometheus
285285
extraArgs: {}
286286

287287
fluent-bit:
@@ -344,7 +344,7 @@ fluent-bit:
344344
[OUTPUT]
345345
Name http
346346
Match kube.*
347-
Host vlogs-generic.{{ .Values.global.target }}.svc.{{ (index .Values._cluster "cluster-domain") | default "cluster.local" }}
347+
Host vlogs-generic.{{ .Values.global.target }}.svc
348348
port 9428
349349
compress gzip
350350
uri /insert/jsonline?_stream_fields=log_source,stream,kubernetes_pod_name,kubernetes_container_name,kubernetes_namespace_name&_msg_field=log&_time_field=date
@@ -355,7 +355,7 @@ fluent-bit:
355355
[OUTPUT]
356356
Name http
357357
Match events.*
358-
Host vlogs-generic.{{ .Values.global.target }}.svc.{{ (index .Values._cluster "cluster-domain") | default "cluster.local" }}
358+
Host vlogs-generic.{{ .Values.global.target }}.svc
359359
port 9428
360360
compress gzip
361361
uri /insert/jsonline?_stream_fields=log_source,reason,meatdata_namespace,metadata_name&_msg_field=message&_time_field=date
@@ -366,7 +366,7 @@ fluent-bit:
366366
[OUTPUT]
367367
Name http
368368
Match audit.*
369-
Host vlogs-generic.{{ .Values.global.target }}.svc.{{ (index .Values._cluster "cluster-domain") | default "cluster.local" }}
369+
Host vlogs-generic.{{ .Values.global.target }}.svc
370370
port 9428
371371
compress gzip
372372
uri /insert/jsonline?_stream_fields=log_source,stage,user_username,verb,requestUri&_msg_field=requestURI&_time_field=date

0 commit comments

Comments
 (0)