Skip to content

Commit 1d98549

Browse files
Add e2e test for prometheus scrape classes
Signed-off-by: Christian Ciach <christian.ciach@gmail.com>
1 parent e9eed47 commit 1d98549

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/e2e-targetallocator/targetallocator-prometheuscr/02-install.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ spec:
2929
scrapeInterval: 1s
3030
scrapeConfigSelector: {}
3131
probeSelector: {}
32+
scrapeClasses:
33+
- name: tls-config
34+
tlsConfig:
35+
caFile: /scrapeclass-ca.pem
3236
serviceAccount: ta
3337
---
3438
apiVersion: monitoring.coreos.com/v1alpha1
@@ -45,6 +49,7 @@ metadata:
4549
name: blackbox-exporter
4650
spec:
4751
jobName: http-get
52+
scrapeClass: tls-config
4853
interval: 60s
4954
module: http_2xx
5055
prober:
@@ -77,6 +82,25 @@ spec:
7782
---
7883
apiVersion: batch/v1
7984
kind: Job
85+
metadata:
86+
name: check-ta-scrape-config-with-scrape-class-v1beta1
87+
spec:
88+
template:
89+
metadata:
90+
labels:
91+
checker: "true"
92+
spec:
93+
restartPolicy: OnFailure
94+
containers:
95+
- name: check-metrics
96+
image: docker.io/curlimages/curl:latest
97+
args:
98+
- /bin/sh
99+
- -c
100+
- curl -s http://prometheus-cr-v1beta1-targetallocator/scrape_configs | grep "/scrapeclass-ca.pem"
101+
---
102+
apiVersion: batch/v1
103+
kind: Job
80104
metadata:
81105
name: check-ta-jobs-scrape-configs-v1beta1
82106
spec:

0 commit comments

Comments
 (0)