Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 0 additions & 12 deletions tests/templates/kuttl/metrics/10-assert.yaml

This file was deleted.

11 changes: 4 additions & 7 deletions tests/templates/kuttl/metrics/10-install-prometheus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@
apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
# The kube-prometheus-stack Helm chart installs cluster wide
# resources, e.g. ClusterRoles. If all test cases use the same Helm
# chart version, then their contents are equal. Therefore, it is safe
# to take ownership instead of failing if the resources already exist.
# Append the namespace to the Helm release name so that cluster-wide
# resources get unique names.
- script: >
helm install prometheus-stack
helm install prometheus-$NAMESPACE
--namespace $NAMESPACE
--version 77.0.1
--version 80.14.2
--values 10_kube-prometheus-stack-values.yaml
--take-ownership
--wait
oci://ghcr.io/prometheus-community/charts/kube-prometheus-stack
timeout: 600
52 changes: 6 additions & 46 deletions tests/templates/kuttl/metrics/11-create-service-monitor.yaml
Original file line number Diff line number Diff line change
@@ -1,47 +1,7 @@
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: stackable-opensearch
labels:
release: prometheus-stack
spec:
selector:
matchLabels:
prometheus.io/scrape: "true"
endpoints:
- relabelings:
- sourceLabels:
- __meta_kubernetes_service_annotation_prometheus_io_scheme
action: replace
targetLabel: __scheme__
regex: (https?)
- sourceLabels:
- __meta_kubernetes_service_annotation_prometheus_io_path
action: replace
targetLabel: __metrics_path__
regex: (.+)
# Use the FQDN instead of the IP address because the IP address
# is not contained in the certificate.
- sourceLabels:
- __meta_kubernetes_pod_name
- __meta_kubernetes_service_name
- __meta_kubernetes_namespace
- __meta_kubernetes_service_annotation_prometheus_io_port
action: replace
targetLabel: __address__
regex: (.+);(.+);(.+);(\d+)
replacement: $1.$2.$3.svc.cluster.local:$4
tlsConfig:
ca:
configMap:
name: truststore
key: ca.crt
---
apiVersion: secrets.stackable.tech/v1alpha1
kind: TrustStore
metadata:
name: truststore
spec:
secretClassName: tls
format: tls-pem
apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
- script: >
envsubst '$NAMESPACE' < 11_service-monitor.yaml |
kubectl apply -n $NAMESPACE -f -
47 changes: 47 additions & 0 deletions tests/templates/kuttl/metrics/11_service-monitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: stackable-opensearch
labels:
release: prometheus-$NAMESPACE
spec:
selector:
matchLabels:
prometheus.io/scrape: "true"
endpoints:
- relabelings:
- sourceLabels:
- __meta_kubernetes_service_annotation_prometheus_io_scheme
action: replace
targetLabel: __scheme__
regex: (https?)
- sourceLabels:
- __meta_kubernetes_service_annotation_prometheus_io_path
action: replace
targetLabel: __metrics_path__
regex: (.+)
# Use the FQDN instead of the IP address because the IP address
# is not contained in the certificate.
- sourceLabels:
- __meta_kubernetes_pod_name
- __meta_kubernetes_service_name
- __meta_kubernetes_namespace
- __meta_kubernetes_service_annotation_prometheus_io_port
action: replace
targetLabel: __address__
regex: (.+);(.+);(.+);(\d+)
replacement: $1.$2.$3.svc.cluster.local:$4
tlsConfig:
ca:
configMap:
name: truststore
key: ca.crt
---
apiVersion: secrets.stackable.tech/v1alpha1
kind: TrustStore
metadata:
name: truststore
spec:
secretClassName: tls
format: tls-pem