Skip to content

Commit a4c20e6

Browse files
committed
Test case for scraping OpenShift in-cluster monitroing stack
1 parent d1fae0d commit a4c20e6

File tree

2 files changed

+73
-0
lines changed

2 files changed

+73
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
apiVersion: v1
2+
kind: Namespace
3+
metadata:
4+
name: chainsaw-scrape-in-cluster-monitoring
5+
spec: {}
6+
7+
---
8+
apiVersion: rbac.authorization.k8s.io/v1
9+
kind: ClusterRoleBinding
10+
metadata:
11+
name: otel-collector
12+
roleRef:
13+
apiGroup: rbac.authorization.k8s.io
14+
kind: ClusterRole
15+
name: cluster-monitoring-view
16+
subjects:
17+
- kind: ServiceAccount
18+
name: otel-collector
19+
namespace: chainsaw-scrape-in-cluster-monitoring
20+
21+
---
22+
kind: ConfigMap
23+
apiVersion: v1
24+
metadata:
25+
name: cabundle
26+
namespce: chainsaw-scrape-in-cluster-monitoring
27+
annotations:
28+
service.beta.openshift.io/inject-cabundle: "true"
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
apiVersion: opentelemetry.io/v1alpha1
2+
kind: OpenTelemetryCollector
3+
metadata:
4+
name: otel
5+
namespace: chainsaw-scrape-in-cluster-monitoring
6+
spec:
7+
volumeMounts:
8+
- name: cabundle-volume
9+
mountPath: /etc/pki/ca-trust/source/service-ca
10+
readOnly: true
11+
volumes:
12+
- name: cabundle-volume
13+
configMap:
14+
name: cabundle
15+
mode: deployment
16+
config: |
17+
receivers:
18+
prometheus:
19+
config:
20+
scrape_configs:
21+
- job_name: 'federate'
22+
scrape_interval: 15s
23+
scheme: https
24+
tls_config:
25+
ca_file: /etc/pki/ca-trust/source/service-ca/service-ca.crt
26+
bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
27+
honor_labels: true
28+
params:
29+
'match[]':
30+
- '{__name__="kube_pod_container_state_started"}'
31+
metrics_path: '/federate'
32+
static_configs:
33+
- targets:
34+
- "prometheus-k8s.openshift-monitoring.svc.cluster.local:9091"
35+
36+
exporters:
37+
debug:
38+
verbosity: detailed
39+
40+
service:
41+
pipelines:
42+
metrics:
43+
receivers: [prometheus]
44+
processors: []
45+
exporters: [debug]

0 commit comments

Comments
 (0)