Skip to content

Commit 33518e8

Browse files
authored
fix(thanos) disable ruler-svc (#642)
* add flow contorl to ruler svc * bump version * extend thanos ruler chart tests
1 parent ba87bbe commit 33518e8

File tree

5 files changed

+14
-8
lines changed

5 files changed

+14
-8
lines changed

thanos/charts/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ maintainers:
1111
name: thanos
1212
sources:
1313
- https://github.com/cloudoperators/greenhouse-extensions
14-
version: 0.2.0
14+
version: 0.2.1
1515
# thanos-release
1616
appVersion: v0.37.2
1717
keywords:

thanos/charts/templates/ruler/ruler-svc.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
# SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors
2-
# SPDX-License-Identifier: Apache-2.0
3-
1+
{{ if and (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1") .Values.thanos.ruler.enabled (not .Values.thanos.query.standalone) }}
42
apiVersion: v1
53
kind: Service
64
metadata:
@@ -27,3 +25,4 @@ spec:
2725
targetPort: http
2826
selector:
2927
app.kubernetes.io/name: thanos-ruler
28+
{{ end}}

thanos/charts/templates/tests/test-permissions.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ rules:
3434
resources: ["pods", "persistentvolumeclaims", "services", "configmaps"]
3535
verbs: ["get", "list"]
3636
- apiGroups: ["monitoring.coreos.com"]
37-
resources: ["servicemonitors"]
37+
resources: ["servicemonitors","thanosrulers"]
3838
verbs: ["get", "list"]
3939
---
4040
apiVersion: rbac.authorization.k8s.io/v1

thanos/charts/templates/tests/test-thanos-config.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,17 @@ data:
4848
{{ if and .Values.thanos.ruler.enabled (not .Values.thanos.query.standalone) }}
4949
@test "Verify succesful creation, running status and rulefiles population of Thanos Ruler" {
5050
verify "there is 1 statefulset named 'thanos-ruler-{{ .Release.Name }}'"
51-
verify "there is 1 service named 'thanos-ruler-operated'"
51+
verify "there is 1 service named '{{ .Release.Name }}-ruler'"
52+
verify "there is 1 thanosruler named '{{ .Release.Name }}'"
5253
try "at most 3 times every 5s to get pods named 'thanos-ruler-{{ .Release.Name }}' and verify that '.status.phase' is 'running'"
5354
try "at most 3 times every 5s to get configmaps named '.*(ruler)+.*(rulefiles)+.*' and verify that '.data' matches '.*yaml.*'"
5455
}
56+
{{ else }}
57+
@test "Verify that no Thanos Ruler ressource is created" {
58+
verify "there is 0 statefulset named 'thanos-ruler-{{ .Release.Name }}'"
59+
verify "there is 0 thanosruler named '{{ .Release.Name }}'"
60+
verify "there is 0 service named '{{ .Release.Name }}-ruler'"
61+
}
5562
{{ end }}
5663
5764
{{ if .Values.thanos.serviceMonitor.selfMonitor }}

thanos/plugindefinition.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ kind: PluginDefinition
66
metadata:
77
name: thanos
88
spec:
9-
version: 0.3.0
9+
version: 0.3.1
1010
description: thanos
1111
helmChart:
1212
name: thanos
1313
repository: "oci://ghcr.io/cloudoperators/greenhouse-extensions/charts"
14-
version: 0.2.0
14+
version: 0.2.1
1515
options:
1616
- default: null
1717
description: CLI param for Thanos Query

0 commit comments

Comments
 (0)