Skip to content

Commit d8bb352

Browse files
kvapsclaude
andcommitted
fix(monitoring-agents): revert _cluster FQDN and use cluster-domain in tenant HelmRelease
PR #2075 added _cluster.cluster-domain references to monitoring-agents values.yaml for FQDN resolution. This broke fluent-bit because it is a subchart where _cluster values are not accessible (only global values are shared with subcharts), causing "index of untyped nil". Revert values.yaml to short DNS names (.svc) for the management cluster where they resolve locally, and add FQDN with cluster-domain suffix in the tenant kubernetes HelmRelease where _cluster values are available and cross-cluster DNS resolution is needed. Closes #2084 Co-Authored-By: Claude <[email protected]> Signed-off-by: Andrei Kvapil <[email protected]>
1 parent e3a5933 commit d8bb352

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)