Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(thanos) ruler component #534

Merged
merged 34 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
46903d6
add ruler + ruler-svc templates
trouaux Nov 29, 2024
654183c
remove label helm.sh
trouaux Nov 29, 2024
2525a23
lint clean up
trouaux Nov 29, 2024
7b0adb2
ruler bats testing + extra labels
trouaux Nov 29, 2024
82884d6
Merge branch 'main' into thanos-ruler-component
trouaux Dec 9, 2024
68c91dc
re-org values + clean-up ruler template
trouaux Dec 9, 2024
a047918
values naming fix
trouaux Dec 12, 2024
5e2d852
update container args + volume mounts
trouaux Dec 12, 2024
eda4ccb
clean up
trouaux Jan 6, 2025
8c674b6
remove comment conflict
trouaux Jan 6, 2025
178b31b
thanos ruler with k8s operator
trouaux Jan 7, 2025
350cfd1
CI test with prometheus operator
trouaux Jan 7, 2025
0f6c944
lint fix + chart lock
trouaux Jan 7, 2025
94c51d7
template objectstore volume for store and compactor
trouaux Jan 7, 2025
12e25c7
relocate CI folder
trouaux Jan 7, 2025
f83bed9
lint
trouaux Jan 7, 2025
5414f41
values indent
trouaux Jan 7, 2025
28dff8a
split ci test ressources
trouaux Jan 8, 2025
4faa807
clean up
trouaux Jan 8, 2025
058d29b
fix bats test + new specs to ruler
trouaux Jan 8, 2025
cbfff2d
test clean up
trouaux Jan 8, 2025
0832396
ruler enabled conditions
trouaux Jan 9, 2025
ad72e24
test typo
trouaux Jan 9, 2025
76240be
update thanos ruler tests
trouaux Jan 9, 2025
c219a5f
CI bug
trouaux Jan 9, 2025
54b4e52
common matching labels for CI
trouaux Jan 9, 2025
5592cb9
yaml typo
trouaux Jan 9, 2025
a33baea
clean up ci yaml values
trouaux Jan 21, 2025
f41ce74
fix suggestions
trouaux Jan 24, 2025
82c5944
alertmanager ressources for ruler config
trouaux Jan 24, 2025
f74464c
feat alertmanager config templates
trouaux Jan 24, 2025
acf165e
fix configmap name
trouaux Jan 24, 2025
1426ac8
rework ruler labels
trouaux Jan 27, 2025
4c832c4
feat: routePrefix
trouaux Jan 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions thanos/charts/ci/test-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,9 @@ ci:
thanos:
ruler:
matchLabel: thanos
alertmanagers:
authentication:
enabled: true
ssoCert:
ssoKey:
hosts:
14 changes: 14 additions & 0 deletions thanos/charts/templates/ruler/_alertmanager.yaml.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{{- define "alertmanagers.config" }}
alertmanagers:
- scheme: https
timeout: 10s
api_version: v2
{{- if .Values.thanos.ruler.alertmanagers.authentication.enabled }}
http_config:
tls_config:
cert_file: /etc/thanos/secrets/thanos-ruler-{{ include "release.name" . }}-alertmanager-sso-cert/sso.crt
key_file: /etc/thanos/secrets/thanos-ruler-{{ include "release.name" . }}-alertmanager-sso-cert/sso.key
{{- end }}
static_configs:
{{ toYaml .Values.thanos.ruler.alertmanagers.hosts | indent 8 }}
{{- end }}
11 changes: 11 additions & 0 deletions thanos/charts/templates/ruler/alertmanager-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{ if .Values.thanos.ruler.enabled }}
trouaux marked this conversation as resolved.
Show resolved Hide resolved
apiVersion: v1
kind: Secret
metadata:
name: {{ include "release.name" . }}-alertmanager-config
labels:
thanos: {{ include "release.name" . }}
data:
alertManagerConfig.yaml: |
{{ template "alertmanagers.config" . }}
{{ end }}
10 changes: 10 additions & 0 deletions thanos/charts/templates/ruler/alertmanager-sso-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{{ if .Values.thanos.ruler.alertmanagers.authentication.enabled }}
apiVersion: v1
kind: Secret
type: Opaque
metadata:
name: thanos-ruler-{{ include "release.name" . }}-alertmanager-sso-cert
data:
sso.crt: {{ required ".Values.thanos.ruler.alertmanagers.authentication.ssoCert missing" .Values.thanos.ruler.alertmanagers.authentication.ssoCert }}
sso.key: {{ required ".Values.thanos.ruler.alertmanagers.authentication.ssoKey missing" .Values.thanos.ruler.alertmanagers.authentication.ssoKey }}
{{ end }}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse c
SPDX-License-Identifier: Apache-2.0
*/}}

{{- if and (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1") .Values.thanos.ruler.enabled }}
{{ if and (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1") .Values.thanos.ruler.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ThanosRuler
metadata:
Expand All @@ -29,4 +29,16 @@ spec:
{{ toYaml .Values.thanos.ruler.alertLabels | nindent 4 }}
# Select rules from all namespaces.
ruleNamespaceSelector: {}
{{ if .Values.thanos.ruler.alertmanagers.authentication.enabled }}
containers:
- name: thanos-ruler
volumeMounts:
- mountPath: /etc/thanos/secrets/thanos-ruler-{{ include "release.name" . }}-alertmanager-sso-cert
name: thanos-ruler-{{ include "release.name" . }}-alertmanager-sso-cert
readOnly: true
volumes:
- name: thanos-ruler-{{ include "release.name" . }}-alertmanager-sso-cert
secret:
secretName: thanos-ruler-{{ include "release.name" . }}-alertmanager-sso-cert
{{ end }}
{{ end }}
10 changes: 0 additions & 10 deletions thanos/charts/templates/tests/test-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,4 @@ data:
thanos.yaml: >-
dHlwZTogRklMRVNZU1RFTQpjb25maWc6CiAgZGlyZWN0b3J5OiAiL3Rlc3QiCnByZWZpeDogIiIKCgogICMga3ViZWN0bCBjcmVhdGUgc2VjcmV0IGdlbmVyaWMgb2JqZWN0LXN0b3JlLXNlY3JldCAtLWZyb20tZmlsZT10aGFub3MueWFtbD0uL3Rlc3Qtc2VjcmV0LnlhbWwgLW4gZGVtbwo=
type: Opaque
---
apiVersion: v1
kind: Secret
type: Opaque
metadata:
name: {{ include "release.name" . }}-alertmanager-config
labels:
thanos: {{ include "release.name" . }}
data:
alertManagerConfig.yaml: ""
{{- end -}}
7 changes: 7 additions & 0 deletions thanos/charts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,13 @@ thanos:

matchLabel:

alertmanagers:
authentication:
enabled: true
ssoCert:
ssoKey:
hosts:

testFramework:
enabled: true
image:
Expand Down
Loading