Skip to content

Commit

Permalink
[kube-prometheus-stack] Thanos Ruler: Add alertDropLabels + additiona…
Browse files Browse the repository at this point in the history
…l config (#4445)

* [kube-prometheus-stack] Thanos Ruler: Add alertDropLabels + additionalConfig

Signed-off-by: Jan-Otto Kröpke <joe@cloudeteer.de>

* [kube-prometheus-stack] Thanos Ruler: Add tpl to labels and additionalArgs

Signed-off-by: Jan-Otto Kröpke <joe@cloudeteer.de>

* [kube-prometheus-stack] Thanos Ruler: Support omit externalPrefix

Signed-off-by: Jan-Otto Kröpke <joe@cloudeteer.de>

---------

Signed-off-by: Jan-Otto Kröpke <joe@cloudeteer.de>
  • Loading branch information
jkroepke committed Apr 12, 2024
1 parent 56ec2c6 commit c6abc8f
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 5 deletions.
2 changes: 1 addition & 1 deletion charts/kube-prometheus-stack/Chart.yaml
Expand Up @@ -23,7 +23,7 @@ name: kube-prometheus-stack
sources:
- https://github.com/prometheus-community/helm-charts
- https://github.com/prometheus-operator/kube-prometheus
version: 58.0.1
version: 58.1.0
appVersion: v0.73.0
kubeVersion: ">=1.19.0-0"
home: https://github.com/prometheus-operator/kube-prometheus
Expand Down
18 changes: 14 additions & 4 deletions charts/kube-prometheus-stack/templates/thanos-ruler/ruler.yaml
Expand Up @@ -34,12 +34,12 @@ spec:
externalPrefix: "{{ tpl .Values.thanosRuler.thanosRulerSpec.externalPrefix . }}"
{{- else if and .Values.thanosRuler.ingress.enabled .Values.thanosRuler.ingress.hosts }}
externalPrefix: "http://{{ tpl (index .Values.thanosRuler.ingress.hosts 0) . }}{{ .Values.thanosRuler.thanosRulerSpec.routePrefix }}"
{{- else }}
externalPrefix: http://{{ template "kube-prometheus-stack.thanosRuler.name" . }}.{{ template "kube-prometheus-stack.namespace" . }}:{{ .Values.thanosRuler.service.port }}
{{- else if .Values.thanosRuler.thanosRulerSpec.externalPrefixNilUsesHelmValues }}
externalPrefix: "http://{{ template "kube-prometheus-stack.thanosRuler.name" . }}.{{ template "kube-prometheus-stack.namespace" . }}:{{ .Values.thanosRuler.service.port }}"
{{- end }}
{{- if .Values.thanosRuler.thanosRulerSpec.additionalArgs }}
additionalArgs:
{{ toYaml .Values.thanosRuler.thanosRulerSpec.additionalArgs | indent 4 }}
{{ tpl (toYaml .Values.thanosRuler.thanosRulerSpec.additionalArgs) $ | indent 4 }}
{{- end }}
{{- if .Values.thanosRuler.thanosRulerSpec.nodeSelector }}
nodeSelector:
Expand Down Expand Up @@ -123,7 +123,7 @@ spec:
{{- end }}
{{- if .Values.thanosRuler.thanosRulerSpec.labels }}
labels:
{{ toYaml .Values.thanosRuler.thanosRulerSpec.labels | indent 4 }}
{{ tpl (toYaml .Values.thanosRuler.thanosRulerSpec.labels) $ | indent 4 }}
{{- end }}
{{- if .Values.thanosRuler.thanosRulerSpec.podMetadata }}
podMetadata:
Expand Down Expand Up @@ -184,6 +184,16 @@ spec:
{{- if .Values.thanosRuler.thanosRulerSpec.volumeMounts }}
volumeMounts:
{{ toYaml .Values.thanosRuler.thanosRulerSpec.volumeMounts | indent 4 }}
{{- end }}
{{- if .Values.thanosRuler.thanosRulerSpec.alertDropLabels }}
alertDropLabels:
{{ toYaml .Values.thanosRuler.thanosRulerSpec.alertDropLabels | indent 4 }}
{{- end }}
portName: {{ .Values.thanosRuler.thanosRulerSpec.portName }}
{{- with .Values.thanosRuler.thanosRulerSpec.additionalConfig }}
{{- tpl (toYaml .) $ | nindent 2 }}
{{- end }}
{{- with .Values.thanosRuler.thanosRulerSpec.additionalConfigString }}
{{- tpl . $ | nindent 2 }}
{{- end }}
{{- end }}
15 changes: 15 additions & 0 deletions charts/kube-prometheus-stack/values.yaml
Expand Up @@ -4431,6 +4431,10 @@ thanosRuler:
##
externalPrefix:

## If true, http://{{ template "kube-prometheus-stack.thanosRuler.name" . }}.{{ template "kube-prometheus-stack.namespace" . }}:{{ .Values.thanosRuler.service.port }}
## will be used as value for externalPrefix
externalPrefixNilUsesHelmValues: true

## The route prefix ThanosRuler registers HTTP handlers for. This is useful, if using ExternalURL and a proxy is rewriting HTTP routes of a request, and the actual ExternalURL is still true,
## but the server serves requests under a different route prefix. For example for use with kubectl proxy.
##
Expand All @@ -4453,6 +4457,10 @@ thanosRuler:
# access_key: ""
# secret_key: ""

## Labels by name to drop before sending to alertmanager
## Maps to the --alert.label-drop flag of thanos ruler.
alertDropLabels: []

## QueryEndpoints defines Thanos querier endpoints from which to query metrics.
## Maps to the --query flag of thanos ruler.
queryEndpoints: []
Expand Down Expand Up @@ -4593,6 +4601,13 @@ thanosRuler:
##
portName: "web"

## Additional configuration which is not covered by the properties above. (passed through tpl)
additionalConfig: {}

## Additional configuration which is not covered by the properties above.
## Useful, if you need advanced templating
additionalConfigString: ""

## ExtraSecret can be used to store various data in an extra secret
## (use it for example to store hashed basic auth credentials)
extraSecret:
Expand Down

0 comments on commit c6abc8f

Please sign in to comment.