Skip to content

Commit 58b5b86

Browse files
test(metrics): Install Prometheus (and the ServiceMonitor CRD) before the ServiceMonitor
1 parent 4ad873c commit 58b5b86

5 files changed

Lines changed: 23 additions & 18 deletions

File tree

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
apiVersion: kuttl.dev/v1beta1
3+
kind: TestStep
4+
commands:
5+
# Append the namespace to the Helm release name so that cluster-wide
6+
# resources get unique names.
7+
- script: >
8+
helm install prometheus-$NAMESPACE
9+
--namespace $NAMESPACE
10+
--version 80.14.2
11+
--values 10_kube-prometheus-stack-values.yaml
12+
--wait
13+
oci://ghcr.io/prometheus-community/charts/kube-prometheus-stack
14+
timeout: 600

tests/templates/kuttl/metrics/11_kube-prometheus-stack-values.yaml renamed to tests/templates/kuttl/metrics/10_kube-prometheus-stack-values.yaml

File renamed without changes.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
apiVersion: kuttl.dev/v1beta1
3+
kind: TestStep
4+
commands:
5+
- script: >
6+
envsubst '$NAMESPACE' < 11_service-monitor.yaml |
7+
kubectl apply -n $NAMESPACE -f -

tests/templates/kuttl/metrics/11-install-prometheus.yaml

Lines changed: 0 additions & 18 deletions
This file was deleted.

tests/templates/kuttl/metrics/10-create-service-monitor.yaml renamed to tests/templates/kuttl/metrics/11_service-monitor.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ apiVersion: monitoring.coreos.com/v1
33
kind: ServiceMonitor
44
metadata:
55
name: stackable-opensearch
6+
labels:
7+
release: prometheus-$NAMESPACE
68
spec:
79
selector:
810
matchLabels:

0 commit comments

Comments
 (0)