Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions operator/api/v1alpha1/vllmruntime_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,15 @@ type VLLMRuntimeStatus struct {
// Current replica count (used by scale subresource)
Replicas int32 `json:"replicas,omitempty"`

// Number of pods that are ready and serving traffic
AvailableReplicas int32 `json:"availableReplicas,omitempty"`

// Number of pods running the latest pod template
UpdatedReplicas int32 `json:"updatedReplicas,omitempty"`

// Number of pods that are not yet available
UnavailableReplicas int32 `json:"unavailableReplicas,omitempty"`

// Label selector for pods (used by scale subresource for HPA AverageValue)
Selector string `json:"selector,omitempty"`
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,10 @@ spec:
status:
description: VLLMRuntimeStatus defines the observed state of VLLMRuntime
properties:
availableReplicas:
description: Number of pods that are ready and serving traffic
format: int32
type: integer
lastUpdated:
description: Last updated timestamp
format: date-time
Expand All @@ -561,6 +565,14 @@ spec:
description: Label selector for pods (used by scale subresource for
HPA AverageValue)
type: string
unavailableReplicas:
description: Number of pods that are not yet available
format: int32
type: integer
updatedReplicas:
description: Number of pods running the latest pod template
format: int32
type: integer
type: object
type: object
served: true
Expand Down
15 changes: 14 additions & 1 deletion operator/internal/controller/vllmruntime_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"fmt"
"maps"
"reflect"
"strings"

appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -1066,6 +1067,11 @@ func (r *VLLMRuntimeReconciler) updateStatus(
latestVR.Status.Replicas = dep.Status.Replicas
latestVR.Status.Selector = metav1.FormatLabelSelector(dep.Spec.Selector)

// Expose additional deployment status fields
latestVR.Status.AvailableReplicas = dep.Status.AvailableReplicas
latestVR.Status.UpdatedReplicas = dep.Status.UpdatedReplicas
latestVR.Status.UnavailableReplicas = dep.Status.UnavailableReplicas

return r.Status().Update(ctx, latestVR)
})
}
Expand All @@ -1089,6 +1095,13 @@ func (r *VLLMRuntimeReconciler) reconcileScaledObject(

prometheusAddr := cfg.Triggers.PrometheusAddress
servedModelName := vllmRuntime.Spec.Model.ModelURL
// Check extraArgs for --served-model-name override
for _, arg := range vllmRuntime.Spec.VLLMConfig.ExtraArgs {
if strings.HasPrefix(arg, "--served-model-name=") {
servedModelName = strings.TrimPrefix(arg, "--served-model-name=")
break
}
}
Comment thread
aeon-x marked this conversation as resolved.

spec := map[string]interface{}{
"scaleTargetRef": map[string]interface{}{
Expand Down Expand Up @@ -1125,7 +1138,7 @@ func (r *VLLMRuntimeReconciler) reconcileScaledObject(
"metadata": map[string]string{
"serverAddress": prometheusAddr,
"metricName": "vllm_incoming_keepalive",
"query": fmt.Sprintf(`sum(rate(vllm:num_incoming_requests_total{namespace="%s", model="%s"}[1m]) > bool 0)`, vllmRuntime.Namespace, servedModelName),
"query": fmt.Sprintf(`sum(rate(vllm:num_incoming_requests_total{namespace="%s", model="%s"}[2m]) > bool 0)`, vllmRuntime.Namespace, servedModelName),
"threshold": "1",
},
},
Expand Down
Loading