Skip to content

Commit d1788d6

Browse files
authored
Merge pull request #85 from alimaredia/add-podmonitor-resource
Add PodMonitor resource for Prometheus monitoring
2 parents e33209c + 23544c9 commit d1788d6

File tree

4 files changed

+41
-0
lines changed

4 files changed

+41
-0
lines changed

config/overlays/odh/kustomization.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,22 @@ namespace: opendatahub
1313
# 2. Import base configuration
1414
resources:
1515
- ../../default # Inherits everything from config/default/
16+
- ../../prometheus
1617
- networkpolicy.yaml
1718

1819
# 3. Delete the Namespace resource (ODH operator manages it)
20+
# Add monitoring label to PodMonitor
1921
patches:
2022
- path: delete-namespace.yaml
23+
- patch: |-
24+
- op: add
25+
path: /metadata/labels/opendatahub.io~1monitoring
26+
value: "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
@@ -13,11 +13,22 @@ namespace: redhat-ods-applications
1313
# 2. Import base configuration
1414
resources:
1515
- ../../default # Inherits everything from config/default/
16+
- ../../prometheus
1617
- networkpolicy.yaml
1718

1819
# 3. Delete the Namespace resource (RHOAI operator manages it)
20+
# Add monitoring label to PodMonitor
1921
patches:
2022
- path: delete-namespace.yaml
23+
- patch: |-
24+
- op: add
25+
path: /metadata/labels/opendatahub.io~1monitoring
26+
value: "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: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
apiVersion: monitoring.coreos.com/v1
2+
kind: PodMonitor
3+
metadata:
4+
name: spark-operator-metrics-monitor
5+
namespace: system
6+
spec:
7+
podMetricsEndpoints:
8+
- port: metrics
9+
path: /metrics
10+
scheme: http
11+
selector:
12+
matchLabels:
13+
app.kubernetes.io/name: spark-operator
14+
app.kubernetes.io/component: controller

0 commit comments

Comments
 (0)