Skip to content

Commit

Permalink
Fix thanos dual-stack receive monitoring
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
antonincms committed Jun 17, 2024
1 parent 89ef0cf commit d80248e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bitnami/thanos/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions bitnami/thanos/templates/receive/service-headless.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
4 changes: 4 additions & 0 deletions bitnami/thanos/templates/receive/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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" . ) }}
Expand Down

0 comments on commit d80248e

Please sign in to comment.