Skip to content

Commit 9e5610c

Browse files
committed
Add PodMonitor resource for Prometheus monitoring
Add opendatahub.io/monitoring: 'true' label for odh/rhoai overlays. Signed-off-by: Ali Maredia <amaredia@redhat.com>
1 parent 9b2bb8c commit 9e5610c

File tree

5 files changed

+44
-0
lines changed

5 files changed

+44
-0
lines changed

config/default/kustomization.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ resources:
2323
- ../rbac
2424
- ../manager
2525
- ../webhook
26+
- ../prometheus
2627

2728
# Labels applied to all resources
2829
labels:

config/overlays/odh/kustomization.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,19 @@ resources:
1616
- networkpolicy.yaml
1717

1818
# 3. Delete the Namespace resource (ODH operator manages it)
19+
# Add monitoring label to PodMonitor
1920
patches:
2021
- path: delete-namespace.yaml
22+
- patch: |-
23+
- op: add
24+
path: /metadata/labels
25+
value:
26+
opendatahub.io/monitoring: "true"
27+
target:
28+
group: monitoring.coreos.com
29+
version: v1
30+
kind: PodMonitor
31+
name: spark-operator-metrics-monitor
2132
2233
# 4. Add ODH-specific labels
2334
labels:

config/overlays/rhoai/kustomization.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,19 @@ resources:
1616
- networkpolicy.yaml
1717

1818
# 3. Delete the Namespace resource (RHOAI operator manages it)
19+
# Add monitoring label to PodMonitor
1920
patches:
2021
- path: delete-namespace.yaml
22+
- patch: |-
23+
- op: add
24+
path: /metadata/labels
25+
value:
26+
opendatahub.io/monitoring: "true"
27+
target:
28+
group: monitoring.coreos.com
29+
version: v1
30+
kind: PodMonitor
31+
name: spark-operator-metrics-monitor
2132
2233
# 4. Add RHOAI-specific labels
2334
labels:
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
4+
resources:
5+
- podmonitor.yaml

config/prometheus/podmonitor.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
apiVersion: monitoring.coreos.com/v1
2+
kind: PodMonitor
3+
metadata:
4+
name: spark-operator-metrics-monitor
5+
namespace: spark-operator
6+
spec:
7+
podMetricsEndpoints:
8+
- port: metrics
9+
path: /metrics
10+
scheme: http
11+
tlsConfig:
12+
insecureSkipVerify: true
13+
selector:
14+
matchLabels:
15+
app.kubernetes.io/name: spark-operator
16+
app.kubernetes.io/component: controller

0 commit comments

Comments
 (0)