feat(chart): add opt-in enableInTreeAutoscaling support - #27
Open
oren-openteams wants to merge 4 commits into
Open
feat(chart): add opt-in enableInTreeAutoscaling support#27oren-openteams wants to merge 4 commits into
oren-openteams wants to merge 4 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an opt-in
autoscaling.enabledvalue that wires Ray's in-tree autoscaler into the RayCluster spec. Default is off — chart output is byte-identical to today's behaviour for existing consumers.The gap this closes
The chart already exposes
worker.minReplicasandworker.maxReplicas, and the README values table labels both "for autoscaling". But the RayCluster template never emitsenableInTreeAutoscaling: true, so KubeRay ignores those fields and always deploys exactlyworker.replicascount of workers. The result is that settingminReplicas/maxReplicashas no observable effect today.This PR wires the missing top-level flag through a new
autoscaling:values block. Whenautoscaling.enabled: true:enableInTreeAutoscaling: trueon the RayCluster specworker.minReplicasandworker.maxReplicasbecome the scaling rangeautoscalerOptions.idleTimeoutSecondsand.upscalingModeare configurable via the new block (defaults per Ray docs: 60 s andDefault)Changes
chart/values.yaml— new top-levelautoscaling:block withenabled,idleTimeoutSeconds,upscalingMode,resources. All defaults preserve today's static-scaling behaviour.chart/templates/rayservice.yaml— conditionalenableInTreeAutoscaling: true+autoscalerOptionsblock, gated on.Values.autoscaling.enabled.chart/Chart.yaml— minor bump0.4.1 → 0.5.0for the new feature.README.md— four new rows in the values table documenting the block.Backwards compatibility
Default
autoscaling.enabled: false. Rendered manifests for any existing values file are unchanged — the new conditional emits nothing when disabled.Real-world motivation
We hit this while sizing a Ray cluster for a Nebari deployment. The user needed 3+ CPUs on the Ray cluster (checkmaite reserves CPUs for its registry + per-job controller actors before any worker task can be placed). Static bump of
worker.replicasunblocked them, but keeping 4 worker pods running 24/7 is wasteful when the cluster is idle. Autoscaling withminReplicas: 1, maxReplicas: 6would let workers scale to zero-of-what's-needed when the cluster is quiet and up to 6 during active use.Test plan
autoscaling.enabled: false(default) → rendered RayService is byte-identical to pre-PR output. Confirmed viahelm templatediff.autoscaling.enabled: true, worker.minReplicas: 1, worker.maxReplicas: 6→ RayCluster spec hasenableInTreeAutoscaling: true+autoscalerOptions; head pod gets the autoscaler sidecar container; worker count scales up when tasks are submitted and back down afteridleTimeoutSeconds.autoscaling.resources→ sidecar container resources reflect the override.References