From d80248e50a36fbe7f5c149fe8bfc20fa7df263af Mon Sep 17 00:00:00 2001 From: Antonin <9219052+antonincms@users.noreply.github.com> Date: Wed, 12 Jun 2024 10:31:30 +0200 Subject: [PATCH] Fix thanos dual-stack receive monitoring * When "receive.mode: dual-stack" change "app.kubernetes.io/component" label of the thanos-receive service from receive to "receive-distributor" to fix servicemonitor not scrapping the receiver * Only add "prometheus-operator/monitor: true" label to thanos-receive-headless service to avoid having thanos-receive pods scrapped twice when "receive.mode: standalone" Signed-off-by: Antonin <9219052+antonincms@users.noreply.github.com> --- bitnami/thanos/Chart.yaml | 2 +- bitnami/thanos/templates/receive/service-headless.yaml | 2 ++ bitnami/thanos/templates/receive/service.yaml | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/bitnami/thanos/Chart.yaml b/bitnami/thanos/Chart.yaml index 3454cacf2bfa8e..090f619adeef9e 100644 --- a/bitnami/thanos/Chart.yaml +++ b/bitnami/thanos/Chart.yaml @@ -35,4 +35,4 @@ maintainers: name: thanos sources: - https://github.com/bitnami/charts/tree/main/bitnami/thanos -version: 15.7.7 +version: 15.7.8 diff --git a/bitnami/thanos/templates/receive/service-headless.yaml b/bitnami/thanos/templates/receive/service-headless.yaml index 1b159e9dcc050e..53ac932f4af0d4 100644 --- a/bitnami/thanos/templates/receive/service-headless.yaml +++ b/bitnami/thanos/templates/receive/service-headless.yaml @@ -11,7 +11,9 @@ metadata: namespace: {{ include "common.names.namespace" . }} labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: receive + {{- if eq .Values.receive.mode "dual-mode" }} {{- include "thanos.servicemonitor.matchLabels" . | nindent 4 -}} + {{- end }} {{- if or .Values.receive.service.headless.annotations .Values.commonAnnotations }} {{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.receive.service.headless.annotations .Values.commonAnnotations ) "context" . ) }} annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }} diff --git a/bitnami/thanos/templates/receive/service.yaml b/bitnami/thanos/templates/receive/service.yaml index 70ad5b7efcd306..39c3a13f130cc1 100644 --- a/bitnami/thanos/templates/receive/service.yaml +++ b/bitnami/thanos/templates/receive/service.yaml @@ -11,7 +11,11 @@ metadata: namespace: {{ include "common.names.namespace" . }} {{- $labels := include "common.tplvalues.merge" ( dict "values" ( list .Values.receive.service.labels .Values.commonLabels ) "context" . ) }} labels: {{- include "common.labels.standard" ( dict "customLabels" $labels "context" $ ) | nindent 4 }} + {{- if eq .Values.receive.mode "dual-mode" }} + app.kubernetes.io/component: receive-distributor + {{ else }} app.kubernetes.io/component: receive + {{ end }} {{- include "thanos.servicemonitor.matchLabels" . | nindent 4 -}} {{- if or .Values.receive.service.annotations .Values.commonAnnotations }} {{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.receive.service.annotations .Values.commonAnnotations ) "context" . ) }}