Skip to content

Commit

Permalink
e2e test prometheus operator scrape config and probes
Browse files Browse the repository at this point in the history
Signed-off-by: qiyang <[email protected]>
  • Loading branch information
dominicqi committed Nov 22, 2024
1 parent 4960f02 commit c8d4f23
Show file tree
Hide file tree
Showing 2 changed files with 111 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,32 @@ data:
( contains(@, join(':', ['matchexpressions', ' {}}'])) ): false
kind: ConfigMap
metadata:
name: prometheus-cr-v1beta1-targetallocator
name: prometheus-cr-v1beta1-targetallocator
---
apiVersion: batch/v1
kind: Job
metadata:
name: check-ta-jobs-v1beta1
status:
succeeded: 1
---
apiVersion: batch/v1
kind: Job
metadata:
name: check-ta-scrape-configs-v1beta1
status:
succeeded: 1
---
apiVersion: batch/v1
kind: Job
metadata:
name: check-ta-jobs-probes-v1beta1
status:
succeeded: 1
---
apiVersion: batch/v1
kind: Job
metadata:
name: check-ta-probes-configs-v1-beta1
status:
succeeded: 1
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,85 @@ metadata:
spec:
kubernetesSDConfigs:
- role: Node
---
apiVersion: monitoring.coreos.com/v1
kind: Probe
metadata:
name: blackbox-exporter
namespace: monitoring-system
spec:
jobName: http-get
interval: 60s
module: http_2xx
prober:
url: blackbox-exporter.monitoring-system.svc:19115
scheme: http
path: /probe
targets:
staticConfig:
static:
- https://example.com
---
apiVersion: batch/v1
kind: Job
metadata:
name: check-ta-jobs-scrapeconfig-v1beta1
spec:
template:
spec:
restartPolicy: OnFailure
containers:
- name: check-metrics
image: curlimages/curl
args:
- /bin/sh
- -c
- curl -s http://prometheus-cr-v1beta1-targetallocator/scrape_configs | grep "scrape-config-cr"
---
apiVersion: batch/v1
kind: Job
metadata:
name: check-ta-scrape-configs-v1-beta1
spec:
template:
spec:
restartPolicy: OnFailure
containers:
- name: check-metrics
image: curlimages/curl
args:
- /bin/sh
- -c
- curl -s http://prometheus-cr-v1beta1-targetallocator/jobs | grep "scrape-config-cr"
---
apiVersion: batch/v1
kind: Job
metadata:
name: check-ta-probes-configs-v1beta1
spec:
template:
spec:
restartPolicy: OnFailure
containers:
- name: check-metrics
image: curlimages/curl
args:
- /bin/sh
- -c
- curl -s http://prometheus-cr-v1beta1-targetallocator/scrape_configs | grep "blackbox-exporter"
---
apiVersion: batch/v1
kind: Job
metadata:
name: check-ta-jobs-probes-v1-beta1
spec:
template:
spec:
restartPolicy: OnFailure
containers:
- name: check-metrics
image: curlimages/curl
args:
- /bin/sh
- -c
- curl -s http://prometheus-cr-v1beta1-targetallocator/jobs | grep "blackbox-exporter"

0 comments on commit c8d4f23

Please sign in to comment.