-
Notifications
You must be signed in to change notification settings - Fork 84
Add Prometheus monitoring and KEDA autoscaling support #836
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,34 @@ | ||||||||||||||||||||||||||||||||||||||
| {{- if .Values.kthenaRouter.metrics.podMonitor.enabled }} | ||||||||||||||||||||||||||||||||||||||
| apiVersion: monitoring.coreos.com/v1 | ||||||||||||||||||||||||||||||||||||||
| kind: PodMonitor | ||||||||||||||||||||||||||||||||||||||
| metadata: | ||||||||||||||||||||||||||||||||||||||
| name: kthena-inference | ||||||||||||||||||||||||||||||||||||||
| namespace: {{ .Release.Namespace }} | ||||||||||||||||||||||||||||||||||||||
| labels: | ||||||||||||||||||||||||||||||||||||||
| app.kubernetes.io/component: kthena-inference | ||||||||||||||||||||||||||||||||||||||
| release: prometheus | ||||||||||||||||||||||||||||||||||||||
| {{- include "kthena.labels" . | nindent 4 }} | ||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+9
to
+10
|
||||||||||||||||||||||||||||||||||||||
| release: prometheus | |
| {{- include "kthena.labels" . | nindent 4 }} | |
| {{- include "kthena.labels" . | nindent 4 }} | |
| {{- with .Values.kthenaRouter.metrics.podMonitor.additionalLabels }} | |
| {{- toYaml . | nindent 4 }} | |
| {{- end }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The podMetricsEndpoints are hardcoded, which limits flexibility for different inference server backends or custom configurations. It would be better to make these endpoints configurable in values.yaml. This would allow users to easily add or change metric endpoints without modifying the chart template. This change would require adding an endpoints list to values.yaml under kthenaRouter.metrics.podMonitor.
podMetricsEndpoints:
{{- range .Values.kthenaRouter.metrics.podMonitor.endpoints }}
- targetPort: {{ .targetPort }}
path: {{ .path | default "/metrics" }}
interval: {{ $.Values.kthenaRouter.metrics.podMonitor.interval }}
{{- end }}
Copilot
AI
Mar 24, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PodMonitor config will scrape both targetPort: 8000 and targetPort: 30000 on every matched pod. For backends that only expose one of these ports, Prometheus will continuously record scrape failures/target down, which can be noisy and impact alerting. Consider splitting into two PodMonitors selected by a backend label, or make the endpoints list configurable so users only enable the port(s) they actually expose.
| podMetricsEndpoints: | |
| - targetPort: 8000 | |
| path: /metrics | |
| interval: {{ .Values.kthenaRouter.metrics.podMonitor.interval }} | |
| - targetPort: 30000 | |
| path: /metrics | |
| interval: {{ .Values.kthenaRouter.metrics.podMonitor.interval }} | |
| podMetricsEndpoints: | |
| {{- with .Values.kthenaRouter.metrics.podMonitor.podMetricsEndpoints }} | |
| {{- toYaml . | nindent 4 }} | |
| {{- else }} | |
| - targetPort: 8000 | |
| path: /metrics | |
| interval: {{ .Values.kthenaRouter.metrics.podMonitor.interval }} | |
| - targetPort: 30000 | |
| path: /metrics | |
| interval: {{ .Values.kthenaRouter.metrics.podMonitor.interval }} | |
| {{- end }} |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,24 @@ | ||||||||||
| {{- if .Values.kthenaRouter.autoscaling.enabled }} | ||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If {{- if .Values.kthenaRouter.autoscaling.enabled }}
{{- required "A value for kthenaRouter.autoscaling.scaleTargetName is required when autoscaling is enabled" .Values.kthenaRouter.autoscaling.scaleTargetName }} |
||||||||||
| apiVersion: keda.sh/v1alpha1 | ||||||||||
| kind: ScaledObject | ||||||||||
| metadata: | ||||||||||
| name: kthena-inference-scaler | ||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||
| namespace: {{ .Release.Namespace }} | ||||||||||
| labels: | ||||||||||
| app.kubernetes.io/component: kthena-inference | ||||||||||
| {{- include "kthena.labels" . | nindent 4 }} | ||||||||||
| spec: | ||||||||||
| cooldownPeriod: {{ .Values.kthenaRouter.autoscaling.cooldownPeriod }} | ||||||||||
| scaleTargetRef: | ||||||||||
| apiVersion: apps/v1 | ||||||||||
| kind: Deployment | ||||||||||
| name: {{ .Values.kthenaRouter.autoscaling.scaleTargetName }} | ||||||||||
|
||||||||||
| name: {{ .Values.kthenaRouter.autoscaling.scaleTargetName }} | |
| name: {{ required "kthenaRouter.autoscaling.scaleTargetName must be set when autoscaling is enabled" .Values.kthenaRouter.autoscaling.scaleTargetName }} |
Copilot
AI
Mar 24, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
serverAddress and query are rendered unquoted. PromQL expressions commonly include characters ({}, [], ,, :) that can break YAML parsing or be re-interpreted; render these values with | quote to ensure the ScaledObject is always valid YAML regardless of the configured query/address.
| serverAddress: {{ .Values.kthenaRouter.autoscaling.prometheusAddress }} | |
| query: {{ .Values.kthenaRouter.autoscaling.query }} | |
| serverAddress: {{ .Values.kthenaRouter.autoscaling.prometheusAddress | quote }} | |
| query: {{ .Values.kthenaRouter.autoscaling.query | quote }} |
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,22 @@ | ||||||||||||
| {{- if .Values.kthenaRouter.metrics.serviceMonitor.enabled }} | ||||||||||||
| apiVersion: monitoring.coreos.com/v1 | ||||||||||||
| kind: ServiceMonitor | ||||||||||||
| metadata: | ||||||||||||
| name: kthena-router | ||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||
| namespace: {{ .Release.Namespace }} | ||||||||||||
| labels: | ||||||||||||
| app.kubernetes.io/component: kthena-router | ||||||||||||
| release: prometheus | ||||||||||||
|
||||||||||||
| release: prometheus | |
| {{- $prometheusLabels := default (dict "release" "prometheus") .Values.kthenaRouter.metrics.serviceMonitor.prometheusLabels }} | |
| {{- range $key, $value := $prometheusLabels }} | |
| {{ $key }}: {{ $value }} | |
| {{- end }} |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -66,6 +66,36 @@ kthenaRouter: | |||||
| # kubeAPIBurst is the burst to use while talking with kubernetes apiserver | ||||||
| # If 0 or not specified, uses default value (10) | ||||||
| kubeAPIBurst: 0 | ||||||
| # metrics configuration for Prometheus monitoring | ||||||
| metrics: | ||||||
| serviceMonitor: | ||||||
| # enabled creates a ServiceMonitor for kthena-router (requires Prometheus Operator) | ||||||
| enabled: false | ||||||
| # interval is the scrape interval for the ServiceMonitor | ||||||
| interval: 15s | ||||||
| podMonitor: | ||||||
| # enabled creates a PodMonitor for inference pods (requires Prometheus Operator) | ||||||
| enabled: false | ||||||
| # interval is the scrape interval for the PodMonitor | ||||||
| interval: 15s | ||||||
|
Comment on lines
+76
to
+80
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The podMonitor:
# enabled creates a PodMonitor for inference pods (requires Prometheus Operator)
enabled: false
# interval is the scrape interval for the PodMonitor
interval: 15s
# endpoints for the PodMonitor to scrape
endpoints:
- { targetPort: 8000, path: /metrics }
- { targetPort: 30000, path: /metrics } |
||||||
| # autoscaling configuration for KEDA-based inference scaling | ||||||
| autoscaling: | ||||||
| # enabled creates a KEDA ScaledObject (requires KEDA) | ||||||
| enabled: false | ||||||
| # scaleTargetName is the name of the Deployment to scale | ||||||
| scaleTargetName: "" | ||||||
|
Comment on lines
+85
to
+86
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The # scaleTargetName is the name of the Deployment to scale (required if autoscaling.enabled is true)
scaleTargetName: "" |
||||||
| # prometheusAddress is the Prometheus server URL | ||||||
| prometheusAddress: http://prometheus-kube-prometheus-prometheus.monitoring.svc:9090 | ||||||
| # query is the PromQL query used for scaling decisions | ||||||
| query: sum(kthena_router_active_downstream_requests) | ||||||
| # threshold is the per-pod metric value that triggers scaling | ||||||
|
||||||
| # threshold is the per-pod metric value that triggers scaling | |
| # threshold is the total metric value across all pods that triggers scaling |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -81,6 +81,34 @@ networking: | |||||
| # -- Enable Gateway API Inference Extension features.<br/> | ||||||
| # Requires `gatewayAPI.enabled` to be true. | ||||||
| inferenceExtension: false | ||||||
| metrics: | ||||||
| serviceMonitor: | ||||||
| # -- Enable ServiceMonitor for kthena-router (requires Prometheus Operator). | ||||||
| enabled: false | ||||||
| # -- Scrape interval for the ServiceMonitor. | ||||||
| interval: 15s | ||||||
| podMonitor: | ||||||
| # -- Enable PodMonitor for inference pods (requires Prometheus Operator). | ||||||
| enabled: false | ||||||
| # -- Scrape interval for the PodMonitor. | ||||||
| interval: 15s | ||||||
|
Comment on lines
+90
to
+94
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The podMonitor:
# -- Enable PodMonitor for inference pods (requires Prometheus Operator).
enabled: false
# -- Scrape interval for the PodMonitor.
interval: 15s
# -- Endpoints for the PodMonitor to scrape.
endpoints:
- { targetPort: 8000, path: /metrics }
- { targetPort: 30000, path: /metrics } |
||||||
| autoscaling: | ||||||
| # -- Enable KEDA ScaledObject for inference autoscaling (requires KEDA). | ||||||
| enabled: false | ||||||
| # -- Name of the Deployment to scale. | ||||||
| scaleTargetName: "" | ||||||
|
Comment on lines
+98
to
+99
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The # -- Name of the Deployment to scale (required if autoscaling.enabled is true).
scaleTargetName: "" |
||||||
| # -- Prometheus server URL for KEDA to query. | ||||||
| prometheusAddress: http://prometheus-kube-prometheus-prometheus.monitoring.svc:9090 | ||||||
| # -- PromQL query for scaling decisions. | ||||||
| query: sum(kthena_router_active_downstream_requests) | ||||||
| # -- Per-pod metric threshold that triggers scaling. | ||||||
|
||||||
| # -- Per-pod metric threshold that triggers scaling. | |
| # -- Metric threshold on the result of the PromQL query that triggers scaling. |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,61 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| apiVersion: monitoring.coreos.com/v1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| kind: ServiceMonitor | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| metadata: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: kthena-router | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| labels: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| app.kubernetes.io/component: kthena-router | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+3
to
+6
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Kubernetes resources in this manifest are not namespaced. It's a best practice to always define a metadata:
name: kthena-router
namespace: default # Or another appropriate namespace
labels:
app.kubernetes.io/component: kthena-router |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| spec: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| selector: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| matchLabels: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| app.kubernetes.io/component: kthena-router | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| endpoints: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - port: http | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| path: /metrics | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| interval: 15s | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| apiVersion: monitoring.coreos.com/v1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| kind: PodMonitor | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| metadata: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: kthena-inference | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| labels: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| app.kubernetes.io/part-of: kthena | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| spec: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| selector: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| matchExpressions: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - key: modelserving.volcano.sh/name | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| operator: Exists | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - key: modelserving.volcano.sh/group-name | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| operator: Exists | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - key: modelserving.volcano.sh/role | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| operator: Exists | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - key: modelserving.volcano.sh/entry | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| operator: In | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| values: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - "true" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| podMetricsEndpoints: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - port: "" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| targetPort: 8000 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| path: /metrics | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| interval: 15s | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - port: "" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| targetPort: 30000 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+36
to
+41
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - port: "" | |
| targetPort: 8000 | |
| path: /metrics | |
| interval: 15s | |
| - port: "" | |
| targetPort: 30000 | |
| - targetPort: 8000 | |
| path: /metrics | |
| interval: 15s | |
| - targetPort: 30000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Prometheus server address is missing the .svc suffix. For cross-namespace service resolution, the FQDN of the service should be used, which is typically in the format <service-name>.<namespace>.svc.cluster.local. While this might work in some cluster configurations depending on DNS search paths, it's more robust to use the full or partial FQDN.
serverAddress: http://prometheus-kube-prometheus-prometheus.monitoring.svc:9090
Copilot
AI
Mar 24, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
serverAddress is set to http://prometheus-kube-prometheus-prometheus.monitoring:9090. In Kubernetes DNS, service.namespace without .svc is not reliably resolvable across namespaces due to search path behavior; use the full service DNS name (e.g., ...monitoring.svc:9090 or ...monitoring.svc.cluster.local:9090) to avoid runtime resolution failures for the KEDA scaler.
| serverAddress: http://prometheus-kube-prometheus-prometheus.monitoring:9090 | |
| serverAddress: http://prometheus-kube-prometheus-prometheus.monitoring.svc:9090 |
Copilot
AI
Mar 24, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This top-level monitoring.yaml duplicates the Helm-rendered ServiceMonitor/PodMonitor/ScaledObject resources added under charts/. That duplication is likely to drift over time (e.g., different Prometheus address, different PodMonitor endpoints), so either move this to an examples/ or docs/ location and clearly mark it as an example, or remove it in favor of the chart templates.
| apiVersion: monitoring.coreos.com/v1 | |
| kind: ServiceMonitor | |
| metadata: | |
| name: kthena-router | |
| labels: | |
| app.kubernetes.io/component: kthena-router | |
| spec: | |
| selector: | |
| matchLabels: | |
| app.kubernetes.io/component: kthena-router | |
| endpoints: | |
| - port: http | |
| path: /metrics | |
| interval: 15s | |
| --- | |
| apiVersion: monitoring.coreos.com/v1 | |
| kind: PodMonitor | |
| metadata: | |
| name: kthena-inference | |
| labels: | |
| app.kubernetes.io/part-of: kthena | |
| spec: | |
| selector: | |
| matchExpressions: | |
| - key: modelserving.volcano.sh/name | |
| operator: Exists | |
| - key: modelserving.volcano.sh/group-name | |
| operator: Exists | |
| - key: modelserving.volcano.sh/role | |
| operator: Exists | |
| - key: modelserving.volcano.sh/entry | |
| operator: In | |
| values: | |
| - "true" | |
| podMetricsEndpoints: | |
| - port: "" | |
| targetPort: 8000 | |
| path: /metrics | |
| interval: 15s | |
| - port: "" | |
| targetPort: 30000 | |
| path: /metrics | |
| interval: 15s | |
| --- | |
| apiVersion: keda.sh/v1alpha1 | |
| kind: ScaledObject | |
| metadata: | |
| name: kthena-inference-scaler | |
| labels: | |
| app.kubernetes.io/part-of: kthena | |
| spec: | |
| minReplicaCount: 1 | |
| maxReplicaCount: 10 | |
| scaleTargetRef: | |
| name: kthena-inference | |
| triggers: | |
| - type: prometheus | |
| metadata: | |
| serverAddress: http://prometheus-kube-prometheus-prometheus.monitoring:9090 | |
| query: sum(kthena_router_active_downstream_requests) | |
| threshold: "5" | |
| # Example monitoring configuration for kthena components. | |
| # | |
| # NOTE: | |
| # - The authoritative ServiceMonitor, PodMonitor, and ScaledObject resources | |
| # are rendered from the Helm charts under the `charts/` directory. | |
| # - This file is kept only as documentation / an example manifest and should | |
| # not be applied directly in environments that use the Helm chart. | |
| # | |
| # If you need to customize monitoring, prefer editing the Helm values/templates | |
| # rather than modifying this example file. | |
| # apiVersion: monitoring.coreos.com/v1 | |
| # kind: ServiceMonitor | |
| # metadata: | |
| # name: kthena-router | |
| # labels: | |
| # app.kubernetes.io/component: kthena-router | |
| # spec: | |
| # selector: | |
| # matchLabels: | |
| # app.kubernetes.io/component: kthena-router | |
| # endpoints: | |
| # - port: http | |
| # path: /metrics | |
| # interval: 15s | |
| # --- | |
| # apiVersion: monitoring.coreos.com/v1 | |
| # kind: PodMonitor | |
| # metadata: | |
| # name: kthena-inference | |
| # labels: | |
| # app.kubernetes.io/part-of: kthena | |
| # spec: | |
| # selector: | |
| # matchExpressions: | |
| # - key: modelserving.volcano.sh/name | |
| # operator: Exists | |
| # - key: modelserving.volcano.sh/group-name | |
| # operator: Exists | |
| # - key: modelserving.volcano.sh/role | |
| # operator: Exists | |
| # - key: modelserving.volcano.sh/entry | |
| # operator: In | |
| # values: | |
| # - "true" | |
| # podMetricsEndpoints: | |
| # - port: "" | |
| # targetPort: 8000 | |
| # path: /metrics | |
| # interval: 15s | |
| # - port: "" | |
| # targetPort: 30000 | |
| # path: /metrics | |
| # interval: 15s | |
| # --- | |
| # apiVersion: keda.sh/v1alpha1 | |
| # kind: ScaledObject | |
| # metadata: | |
| # name: kthena-inference-scaler | |
| # labels: | |
| # app.kubernetes.io/part-of: kthena | |
| # spec: | |
| # minReplicaCount: 1 | |
| # maxReplicaCount: 10 | |
| # scaleTargetRef: | |
| # name: kthena-inference | |
| # triggers: | |
| # - type: prometheus | |
| # metadata: | |
| # serverAddress: http://prometheus-kube-prometheus-prometheus.monitoring:9090 | |
| # query: sum(kthena_router_active_downstream_requests) | |
| # threshold: "5" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The resource name is hardcoded. It's a good practice to use Helm's naming conventions to generate resource names. This ensures names are unique and consistent across releases. Consider using the
kthena.fullnamehelper.