Skip to content

Commit c6964be

Browse files
authored
Merge pull request #4 from nerdalert/ocp-prom
fixup ocp prom manifests
2 parents e394e42 + 24846c4 commit c6964be

File tree

8 files changed

+38
-261
lines changed

8 files changed

+38
-261
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ A comprehensive platform for **Models as a Service** with real-time policy manag
3333

3434
## 🚀 Quick Start
3535

36-
**For deploying Kuadrant on OpenShift, see → [deployment/kuadrant-openshift](deployment/kuadrant-openshift)**
37-
**For manual deployment steps of Kuadrant on Vanilla Kube, see → [deployment/kuadrant-openshift](deployment/kuadrant)**
36+
- **For deploying Kuadrant on OpenShift, see → [deployment/kuadrant-openshift](deployment/kuadrant-openshift)**
37+
- **For manual deployment steps of Kuadrant on Vanilla Kube, see → [deployment/kuadrant-openshift](deployment/kuadrant)**
3838

3939
### 1. Deploy Kuadrant Infrastructure (Dev on vanilla kubernetes)
4040

deployment/kuadrant-openshift/README.md

Lines changed: 34 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -432,30 +432,21 @@ done
432432

433433
### 9. Deploy Observability
434434

435-
Deploy Prometheus and monitoring components:
435+
Deploy ServiceMonitors to integrate with OpenShift's existing Prometheus monitoring:
436436

437437
```bash
438-
# Install Prometheus Operator
439-
kubectl apply --server-side --field-manager=quickstart-installer -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/master/bundle.yaml
440-
441-
# Wait for Prometheus Operator to be ready
442-
kubectl wait --for=condition=Available deployment/prometheus-operator -n default --timeout=300s
443-
444-
# From models-aas/deployment/kuadrant Kuadrant prometheus observability
438+
# Deploy ServiceMonitors for Kuadrant components (no additional Prometheus needed)
445439
kubectl apply -k kustomize/prometheus/
446440

447-
# Wait for Prometheus to be ready
448-
kubectl wait --for=condition=Running prometheus/models-aas-observability -n llm-observability --timeout=300s
449-
450-
# Port-forward to access Prometheus UI
451-
kubectl port-forward -n llm-observability svc/models-aas-observability 9090:9090 &
452-
453-
# Forward Limitador admin metric scrape target
454-
kubectl -n kuadrant-system port-forward svc/limitador-limitador 8080:8080
441+
# Verify ServiceMonitors are created
442+
kubectl get servicemonitor -n kuadrant-system
455443

456-
# Access Prometheus at http://localhost:9090
444+
# Access Grafana Dashboard via OpenShift Route
445+
# Grafana: https://grafana-route-llm-d-observability.apps.summit-gpu.octo-emerging.redhataicoe.com
457446
```
458447

448+
**Note:** This deployment uses OpenShift's built-in user workload monitoring instead of deploying a separate Prometheus instance.
449+
459450
### Query the Limitador Scrape Endpoint
460451

461452
> 🚨 See this issue for status on getting per user scrape data for authorization and limits with Kudrant [Question on mapping authorized_calls metrics to a user](https://github.com/Kuadrant/limitador/issues/434)
@@ -472,51 +463,34 @@ authorized_calls{limitador_namespace="llm/simulator-domain-route"} 100
472463
limited_calls{limitador_namespace="llm/simulator-domain-route"} 16
473464
```
474465

475-
### Query Metrics via Prom API
466+
### Query Metrics via Prometheus
476467

468+
**Option 1: Query via OpenShift User Workload Monitoring Prometheus:**
477469
```bash
478-
# Get limited_calls via Prometheus
479-
curl -sG --data-urlencode 'query=limited_calls' http://localhost:9090/api/v1/query | jq '.data.result'
480-
[
481-
{
482-
"metric": {
483-
"__name__": "limited_calls",
484-
"container": "limitador",
485-
"endpoint": "http",
486-
"instance": "10.244.0.19:8080",
487-
"job": "limitador-limitador",
488-
"limitador_namespace": "llm/simulator-domain-route",
489-
"namespace": "kuadrant-system",
490-
"pod": "limitador-limitador-84bdfb4747-n8h44",
491-
"service": "limitador-limitador"
492-
},
493-
"value": [
494-
1754366303.129,
495-
"16"
496-
]
497-
}
498-
]
499-
500-
curl -sG --data-urlencode 'query=authorized_calls' http://localhost:9090/api/v1/query | jq '.data.result'
501-
[
502-
{
503-
"metric": {
504-
"__name__": "authorized_calls",
505-
"container": "limitador",
506-
"endpoint": "http",
507-
"instance": "10.244.0.19:8080",
508-
"job": "limitador-limitador",
509-
"limitador_namespace": "llm/simulator-domain-route",
510-
"namespace": "kuadrant-system",
511-
"pod": "limitador-limitador-84bdfb4747-n8h44",
512-
"service": "limitador-limitador"
513-
},
514-
"value": [
515-
1754366383.534,
516-
"100"
517-
]
518-
}
519-
]
470+
# Query limited_calls via OpenShift Prometheus
471+
oc exec -n openshift-user-workload-monitoring prometheus-user-workload-0 -c prometheus -- \
472+
curl -s 'http://localhost:9090/api/v1/query' --data-urlencode 'query=limited_calls' | jq '.data.result'
473+
474+
# Query authorized_calls via OpenShift Prometheus
475+
oc exec -n openshift-user-workload-monitoring prometheus-user-workload-0 -c prometheus -- \
476+
curl -s 'http://localhost:9090/api/v1/query' --data-urlencode 'query=authorized_calls' | jq '.data.result'
477+
```
478+
479+
**Option 2: Query metrics directly from Limitador pod:**
480+
```bash
481+
# Query metrics directly from Limitador pod
482+
oc exec -n kuadrant-system deployment/limitador-limitador -- curl -s localhost:8080/metrics | grep calls
483+
484+
# Example output:
485+
# HELP limited_calls Limited calls
486+
# TYPE limited_calls counter
487+
limited_calls{limitador_namespace="llm/simulator-domain-route"} 3
488+
limited_calls{limitador_namespace="llm/qwen3-domain-route"} 6
489+
490+
# HELP authorized_calls Authorized calls
491+
# TYPE authorized_calls counter
492+
authorized_calls{limitador_namespace="llm/qwen3-domain-route"} 27
493+
authorized_calls{limitador_namespace="llm/simulator-domain-route"} 16
520494
```
521495

522496
## Troubleshooting

deployment/kuadrant-openshift/kustomize/prometheus/kuadrant-servicemonitors.yaml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@ apiVersion: monitoring.coreos.com/v1
22
kind: ServiceMonitor
33
metadata:
44
name: authorino-runtime
5+
namespace: kuadrant-system
56
labels:
67
environment: base
78
project: models-aas-observability
89
spec:
9-
namespaceSelector:
10-
matchNames:
11-
- kuadrant-system
1210
selector:
1311
matchLabels:
1412
authorino-resource: authorino
@@ -27,13 +25,11 @@ apiVersion: monitoring.coreos.com/v1
2725
kind: ServiceMonitor
2826
metadata:
2927
name: limitador-runtime
28+
namespace: kuadrant-system
3029
labels:
3130
environment: base
3231
project: models-aas-observability
3332
spec:
34-
namespaceSelector:
35-
matchNames:
36-
- kuadrant-system
3733
selector:
3834
matchLabels:
3935
app: limitador

deployment/kuadrant-openshift/kustomize/prometheus/kustomization.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
apiVersion: kustomize.config.k8s.io/v1beta1
22
kind: Kustomization
33

4-
namespace: llm-observability
5-
64
resources:
7-
- prometheus-config.yaml
8-
- prometheus-deployment.yaml
9-
- prometheus-rbac.yaml
10-
- models-aas-servicemonitor.yaml
115
- kuadrant-servicemonitors.yaml
126

137
labels:

deployment/kuadrant-openshift/kustomize/prometheus/models-aas-servicemonitor.yaml

Lines changed: 0 additions & 49 deletions
This file was deleted.

deployment/kuadrant-openshift/kustomize/prometheus/prometheus-config.yaml

Lines changed: 0 additions & 59 deletions
This file was deleted.

deployment/kuadrant-openshift/kustomize/prometheus/prometheus-deployment.yaml

Lines changed: 0 additions & 37 deletions
This file was deleted.

deployment/kuadrant-openshift/kustomize/prometheus/prometheus-rbac.yaml

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)