# This is a copy from the `ray-cluster.autoscaler-template.yaml` with modifications needed # to make kuberary work with Ray's Autoscaler V2. # See more at `ray-cluster.autoscaler-template.yaml` for the non autoscaler-v2 definition. apiVersion: ray.io/v1 kind: RayCluster metadata: name: raycluster-autoscaler spec: # The version of Ray you are using. Make sure all Ray containers are running this version of Ray. rayVersion: '2.46.0' # If `enableInTreeAutoscaling` is true, the Autoscaler sidecar will be added to the Ray head pod. # Ray Autoscaler integration is Beta with KubeRay >= 0.3.0 and Ray >= 2.0.0. enableInTreeAutoscaling: true autoscalerOptions: # Use version: v2 instead of env var RAY_enable_autoscaler_v2 and restartPolicy: Never below if # you're using KubeRay >= 1.4.0. version: v2 upscalingMode: Default idleTimeoutSeconds: 60 imagePullPolicy: IfNotPresent resources: limits: cpu: "500m" memory: "512Mi" requests: cpu: "500m" memory: "512Mi" headGroupSpec: template: spec: containers: - name: ray-head image: rayproject/ray:2.46.0 ports: - containerPort: 6379 name: gcs - containerPort: 8265 name: dashboard - containerPort: 10001 name: client imagePullPolicy: IfNotPresent lifecycle: preStop: exec: command: ["/bin/sh","-c","ray stop"] resources: limits: cpu: "1" memory: "2G" requests: cpu: "500m" memory: "2G" restartPolicy: Never # No restart to avoid reuse of pod for different ray nodes. workerGroupSpecs: - replicas: 1 minReplicas: 1 maxReplicas: 10 groupName: small-group template: spec: containers: - name: ray-worker image: rayproject/ray:2.46.0 lifecycle: preStop: exec: command: ["/bin/sh","-c","ray stop"] imagePullPolicy: IfNotPresent resources: limits: cpu: "1" memory: "1G" requests: cpu: "500m" memory: "1G" restartPolicy: Never # Never restart a pod to avoid pod reuse