From c5148c2d0d318bcf548598c1fe43d6cd31ee5842 Mon Sep 17 00:00:00 2001 From: Taehyun Kim <11684628+kimxogus@users.noreply.github.com> Date: Sat, 15 Feb 2025 04:57:42 +0900 Subject: [PATCH] Fix in-cluster remote urls when gateway and nginx are disabled (#10625) * Fix in-cluster remote urls when gateway and nginx are disabled * fix template * update CHANGELOG.md * fix CHANGELOG.md * Update operations/helm/charts/mimir-distributed/CHANGELOG.md Co-authored-by: Taylor C <41653732+tacole02@users.noreply.github.com> * Update operations/helm/charts/mimir-distributed/CHANGELOG.md --------- Co-authored-by: Taylor C <41653732+tacole02@users.noreply.github.com> Co-authored-by: Vladimir Varankin --- operations/helm/charts/mimir-distributed/CHANGELOG.md | 1 + .../helm/charts/mimir-distributed/templates/_helpers.tpl | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/operations/helm/charts/mimir-distributed/CHANGELOG.md b/operations/helm/charts/mimir-distributed/CHANGELOG.md index b767133fa0f..e67de3ba204 100644 --- a/operations/helm/charts/mimir-distributed/CHANGELOG.md +++ b/operations/helm/charts/mimir-distributed/CHANGELOG.md @@ -36,6 +36,7 @@ Entries should include a reference to the Pull Request that introduced the chang * [ENHANCEMENT] Individual mimir components can override their container images via the *.image values. The component's image definitions always override the values set in global `image` or `enterprise.image`. #10340 * [ENHANCEMENT] Alertmanager, compactor, ingester, and store-gateway StatefulSets can configure their PVC template name via the corresponding *.persistentVolume.name values. #10376 * [ENHANCEMENT] Set resources for smoke-test job. #10608 +* [BUGFIX] Create proper in-cluster remote URLs when gateway and nginx are disabled. #10625 * [BUGFIX] Fix calculation of `mimir.siToBytes` and use floating point arithmetics. #10044 ## 5.6.0 diff --git a/operations/helm/charts/mimir-distributed/templates/_helpers.tpl b/operations/helm/charts/mimir-distributed/templates/_helpers.tpl index a661a8c84b3..b7608b4e34f 100644 --- a/operations/helm/charts/mimir-distributed/templates/_helpers.tpl +++ b/operations/helm/charts/mimir-distributed/templates/_helpers.tpl @@ -549,11 +549,19 @@ Return if we should create a SecurityContextConstraints. Takes into account user {{- end -}} {{- define "mimir.remoteWriteUrl.inCluster" -}} +{{- if or (eq (include "mimir.gateway.isEnabled" . ) "true") .Values.nginx.enabled -}} {{ include "mimir.gatewayUrl" . }}/api/v1/push +{{- else -}} +http://{{ template "mimir.fullname" . }}-distributor-headless.{{ .Release.Namespace }}.svc:{{ include "mimir.serverHttpListenPort" . }}/api/v1/push +{{- end -}} {{- end -}} {{- define "mimir.remoteReadUrl.inCluster" -}} +{{- if or (eq (include "mimir.gateway.isEnabled" . ) "true") .Values.nginx.enabled -}} {{ include "mimir.gatewayUrl" . }}{{ include "mimir.prometheusHttpPrefix" . }} +{{- else -}} +http://{{ template "mimir.fullname" . }}-query-frontend.{{ .Release.Namespace }}.svc:{{ include "mimir.serverHttpListenPort" . }}{{ include "mimir.prometheusHttpPrefix" . }} +{{- end -}} {{- end -}} {{/*