From 2420c6d2132536ac7e3bc1b4a5fe0337ebd26a76 Mon Sep 17 00:00:00 2001 From: Oren Fromberg <145494346+oren-openteams@users.noreply.github.com> Date: Tue, 28 Jul 2026 12:52:34 -0400 Subject: [PATCH 1/4] apply autoscaling changes to chart/values.yaml --- chart/values.yaml | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/chart/values.yaml b/chart/values.yaml index b25c4d7..4f22c95 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -222,6 +222,52 @@ worker: timeoutSeconds: 2 failureThreshold: 120 +# ============================================================================= +# Ray In-Tree Autoscaling +# ============================================================================= +# Enable Ray's in-tree autoscaler to dynamically scale worker pods based on +# task demand. When `autoscaling.enabled` is true, the chart: +# - Sets `enableInTreeAutoscaling: true` on the RayCluster spec, causing +# KubeRay to attach an autoscaler sidecar container to the head pod. +# - Uses `worker.minReplicas` and `worker.maxReplicas` as the scaling range +# (both fields are already exposed above; without autoscaling enabled +# they are ignored by KubeRay). +# +# Without autoscaling.enabled the chart is byte-identical to the pre-existing +# behaviour: worker.replicas is the deployed count, min/max are inert. +# +# See the KubeRay autoscaling guide for background: +# https://docs.ray.io/en/latest/cluster/kubernetes/user-guides/configuring-autoscaling.html +# +# Ray's docs explicitly note that autoscaling "adds node launch overheads +# and can be tricky to configure" — starting with a fixed replica count +# (autoscaling.enabled: false) is recommended for newcomers. +autoscaling: + enabled: false + + # Time in seconds an idle worker pod is kept alive before being scaled + # down. Lower values reclaim resources faster but can create pod churn if + # tasks arrive in bursts. + idleTimeoutSeconds: 60 + + # upscalingMode: + # - `Default` — standard responsiveness + # - `Conservative` — pending requests scale up in batches on a delay + # - `Aggressive` — immediately upscale to satisfy demand + upscalingMode: Default + + # Optional overrides for the autoscaler sidecar container's resources. + # KubeRay's own defaults apply when unset ({}); typical production + # override: + # resources: + # limits: + # cpu: "500m" + # memory: "512Mi" + # requests: + # cpu: "500m" + # memory: "512Mi" + resources: {} + # ============================================================================= # Overrides # ============================================================================= From fab78d91761dcb7e83c9fef66c787d6c5b205ac2 Mon Sep 17 00:00:00 2001 From: Oren Fromberg <145494346+oren-openteams@users.noreply.github.com> Date: Tue, 28 Jul 2026 12:52:35 -0400 Subject: [PATCH 2/4] apply autoscaling changes to chart/templates/rayservice.yaml --- chart/templates/rayservice.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/chart/templates/rayservice.yaml b/chart/templates/rayservice.yaml index b2475ee..8cdb9be 100644 --- a/chart/templates/rayservice.yaml +++ b/chart/templates/rayservice.yaml @@ -19,6 +19,16 @@ spec: rayClusterConfig: rayVersion: {{ .Values.image.tag | quote }} + {{- if .Values.autoscaling.enabled }} + enableInTreeAutoscaling: true + autoscalerOptions: + idleTimeoutSeconds: {{ .Values.autoscaling.idleTimeoutSeconds }} + upscalingMode: {{ .Values.autoscaling.upscalingMode }} + {{- with .Values.autoscaling.resources }} + resources: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- end }} headGroupSpec: rayStartParams: dashboard-host: "0.0.0.0" From 2c7545d2bdf855eb1fa0bbc320c7ba7157312292 Mon Sep 17 00:00:00 2001 From: Oren Fromberg <145494346+oren-openteams@users.noreply.github.com> Date: Tue, 28 Jul 2026 12:52:36 -0400 Subject: [PATCH 3/4] apply autoscaling changes to chart/Chart.yaml --- chart/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chart/Chart.yaml b/chart/Chart.yaml index ba07c8b..8f0c259 100644 --- a/chart/Chart.yaml +++ b/chart/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: nebari-rayserve-pack description: A Nebari Software Pack for Ray Serve type: application -version: 0.4.1 +version: 0.5.0 appVersion: "2.43.0" dependencies: - name: kuberay-operator From 4fbe44b6b740169d99a55257fc1229df3e1c6179 Mon Sep 17 00:00:00 2001 From: Oren Fromberg <145494346+oren-openteams@users.noreply.github.com> Date: Tue, 28 Jul 2026 12:52:37 -0400 Subject: [PATCH 4/4] apply autoscaling changes to README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index a74e09c..0b36205 100644 --- a/README.md +++ b/README.md @@ -219,6 +219,10 @@ Key values in `chart/values.yaml`: | `worker.resources.requests.cpu` | `1` | Worker CPU request | | `worker.resources.requests.memory` | `2Gi` | Worker memory request | | `worker.runtimeClassName` | - | Runtime class for worker pods (e.g., `nvidia` for GPU) | +| `autoscaling.enabled` | `false` | Enable Ray in-tree autoscaling of worker pods | +| `autoscaling.idleTimeoutSeconds` | `60` | Seconds an idle worker is kept before scale-down | +| `autoscaling.upscalingMode` | `Default` | `Default`, `Conservative`, or `Aggressive` | +| `autoscaling.resources` | `{}` | Optional resources for the autoscaler sidecar container | ### Serve Applications