From 979c27e781d953ddcc18689b027a89dc2ce48c86 Mon Sep 17 00:00:00 2001 From: David Xia Date: Tue, 31 Oct 2023 14:12:05 -0400 Subject: [PATCH] chore: remove `HeadGroupSpec.Replicas` from `raycluster_types.go` It has been deprecated since 0.3.0. Changes to generated files made by running `cd ray-operator && make sync generate manifests`. closes #612 --- helm-chart/kuberay-operator/crds/ray.io_rayclusters.yaml | 6 ------ helm-chart/kuberay-operator/crds/ray.io_rayjobs.yaml | 6 ------ helm-chart/kuberay-operator/crds/ray.io_rayservices.yaml | 6 ------ ray-operator/apis/ray/v1/raycluster_types.go | 2 -- ray-operator/apis/ray/v1/raycluster_types_test.go | 1 - ray-operator/apis/ray/v1/rayjob_types_test.go | 1 - ray-operator/apis/ray/v1/rayservice_types_test.go | 2 -- ray-operator/apis/ray/v1/zz_generated.deepcopy.go | 5 ----- ray-operator/apis/ray/v1alpha1/raycluster_types.go | 2 -- ray-operator/apis/ray/v1alpha1/raycluster_types_test.go | 1 - ray-operator/apis/ray/v1alpha1/rayjob_types_test.go | 1 - ray-operator/apis/ray/v1alpha1/rayservice_types_test.go | 2 -- ray-operator/apis/ray/v1alpha1/zz_generated.deepcopy.go | 5 ----- ray-operator/config/crd/bases/ray.io_rayclusters.yaml | 6 ------ ray-operator/config/crd/bases/ray.io_rayjobs.yaml | 6 ------ ray-operator/config/crd/bases/ray.io_rayservices.yaml | 6 ------ .../ray/batchscheduler/volcano/volcano_scheduler.go | 4 ++-- .../ray/batchscheduler/volcano/volcano_scheduler_test.go | 3 +-- ray-operator/controllers/ray/common/ingress_test.go | 3 --- ray-operator/controllers/ray/common/pod_test.go | 1 - ray-operator/controllers/ray/common/route_test.go | 1 - ray-operator/controllers/ray/common/service_test.go | 2 -- .../controllers/ray/raycluster_controller_fake_test.go | 1 - .../controllers/ray/rayjob_controller_suspended_test.go | 1 - ray-operator/controllers/ray/rayjob_controller_test.go | 1 - .../controllers/ray/rayservice_controller_test.go | 1 - ray-operator/controllers/ray/utils/util.go | 8 ++------ 27 files changed, 5 insertions(+), 79 deletions(-) diff --git a/helm-chart/kuberay-operator/crds/ray.io_rayclusters.yaml b/helm-chart/kuberay-operator/crds/ray.io_rayclusters.yaml index a8238fd24e6..ec23ee7f37e 100644 --- a/helm-chart/kuberay-operator/crds/ray.io_rayclusters.yaml +++ b/helm-chart/kuberay-operator/crds/ray.io_rayclusters.yaml @@ -444,9 +444,6 @@ spec: additionalProperties: type: string type: object - replicas: - format: int32 - type: integer serviceType: type: string template: @@ -7120,9 +7117,6 @@ spec: additionalProperties: type: string type: object - replicas: - format: int32 - type: integer serviceType: type: string template: diff --git a/helm-chart/kuberay-operator/crds/ray.io_rayjobs.yaml b/helm-chart/kuberay-operator/crds/ray.io_rayjobs.yaml index 4838f17ed1f..6fa6edf8f29 100644 --- a/helm-chart/kuberay-operator/crds/ray.io_rayjobs.yaml +++ b/helm-chart/kuberay-operator/crds/ray.io_rayjobs.yaml @@ -443,9 +443,6 @@ spec: additionalProperties: type: string type: object - replicas: - format: int32 - type: integer serviceType: type: string template: @@ -10232,9 +10229,6 @@ spec: additionalProperties: type: string type: object - replicas: - format: int32 - type: integer serviceType: type: string template: diff --git a/helm-chart/kuberay-operator/crds/ray.io_rayservices.yaml b/helm-chart/kuberay-operator/crds/ray.io_rayservices.yaml index 88267a1bfea..7602ce9aa7b 100644 --- a/helm-chart/kuberay-operator/crds/ray.io_rayservices.yaml +++ b/helm-chart/kuberay-operator/crds/ray.io_rayservices.yaml @@ -428,9 +428,6 @@ spec: additionalProperties: type: string type: object - replicas: - format: int32 - type: integer serviceType: type: string template: @@ -7482,9 +7479,6 @@ spec: additionalProperties: type: string type: object - replicas: - format: int32 - type: integer serviceType: type: string template: diff --git a/ray-operator/apis/ray/v1/raycluster_types.go b/ray-operator/apis/ray/v1/raycluster_types.go index 06e815056a5..f980267b2ae 100644 --- a/ray-operator/apis/ray/v1/raycluster_types.go +++ b/ray-operator/apis/ray/v1/raycluster_types.go @@ -33,8 +33,6 @@ type HeadGroupSpec struct { HeadService *v1.Service `json:"headService,omitempty"` // EnableIngress indicates whether operator should create ingress object for head service or not. EnableIngress *bool `json:"enableIngress,omitempty"` - // HeadGroupSpec.Replicas is deprecated and ignored; there can only be one head pod per Ray cluster. - Replicas *int32 `json:"replicas,omitempty"` // RayStartParams are the params of the start command: node-manager-port, object-store-memory, ... RayStartParams map[string]string `json:"rayStartParams"` // Template is the exact pod template used in K8s depoyments, statefulsets, etc. diff --git a/ray-operator/apis/ray/v1/raycluster_types_test.go b/ray-operator/apis/ray/v1/raycluster_types_test.go index f6663954541..cb26e3c2a48 100644 --- a/ray-operator/apis/ray/v1/raycluster_types_test.go +++ b/ray-operator/apis/ray/v1/raycluster_types_test.go @@ -16,7 +16,6 @@ var myRayCluster = &RayCluster{ }, Spec: RayClusterSpec{ HeadGroupSpec: HeadGroupSpec{ - Replicas: pointer.Int32Ptr(1), RayStartParams: map[string]string{ "port": "6379", "object-manager-port": "12345", diff --git a/ray-operator/apis/ray/v1/rayjob_types_test.go b/ray-operator/apis/ray/v1/rayjob_types_test.go index 75e6240486d..dcd4201f0c9 100644 --- a/ray-operator/apis/ray/v1/rayjob_types_test.go +++ b/ray-operator/apis/ray/v1/rayjob_types_test.go @@ -25,7 +25,6 @@ var expectedRayJob = RayJob{ RayClusterSpec: &RayClusterSpec{ RayVersion: "1.12.1", HeadGroupSpec: HeadGroupSpec{ - Replicas: pointer.Int32Ptr(1), RayStartParams: map[string]string{ "port": "6379", "object-store-memory": "100000000", diff --git a/ray-operator/apis/ray/v1/rayservice_types_test.go b/ray-operator/apis/ray/v1/rayservice_types_test.go index 38af735a9f9..c656a4a683a 100644 --- a/ray-operator/apis/ray/v1/rayservice_types_test.go +++ b/ray-operator/apis/ray/v1/rayservice_types_test.go @@ -71,7 +71,6 @@ var myRayService = &RayService{ }, RayClusterSpec: RayClusterSpec{ HeadGroupSpec: HeadGroupSpec{ - Replicas: pointer.Int32Ptr(1), RayStartParams: map[string]string{ "port": "6379", "object-store-memory": "100000000", @@ -236,7 +235,6 @@ var expected = `{ }, "rayClusterConfig":{ "headGroupSpec":{ - "replicas":1, "rayStartParams":{ "dashboard-agent-listen-port":"52365", "dashboard-host":"0.0.0.0", diff --git a/ray-operator/apis/ray/v1/zz_generated.deepcopy.go b/ray-operator/apis/ray/v1/zz_generated.deepcopy.go index 4aaa240753b..3e6b19dfe77 100644 --- a/ray-operator/apis/ray/v1/zz_generated.deepcopy.go +++ b/ray-operator/apis/ray/v1/zz_generated.deepcopy.go @@ -142,11 +142,6 @@ func (in *HeadGroupSpec) DeepCopyInto(out *HeadGroupSpec) { *out = new(bool) **out = **in } - if in.Replicas != nil { - in, out := &in.Replicas, &out.Replicas - *out = new(int32) - **out = **in - } if in.RayStartParams != nil { in, out := &in.RayStartParams, &out.RayStartParams *out = make(map[string]string, len(*in)) diff --git a/ray-operator/apis/ray/v1alpha1/raycluster_types.go b/ray-operator/apis/ray/v1alpha1/raycluster_types.go index 839fb787859..da3912bfe59 100644 --- a/ray-operator/apis/ray/v1alpha1/raycluster_types.go +++ b/ray-operator/apis/ray/v1alpha1/raycluster_types.go @@ -33,8 +33,6 @@ type HeadGroupSpec struct { HeadService *v1.Service `json:"headService,omitempty"` // EnableIngress indicates whether operator should create ingress object for head service or not. EnableIngress *bool `json:"enableIngress,omitempty"` - // HeadGroupSpec.Replicas is deprecated and ignored; there can only be one head pod per Ray cluster. - Replicas *int32 `json:"replicas,omitempty"` // RayStartParams are the params of the start command: node-manager-port, object-store-memory, ... RayStartParams map[string]string `json:"rayStartParams"` // Template is the exact pod template used in K8s depoyments, statefulsets, etc. diff --git a/ray-operator/apis/ray/v1alpha1/raycluster_types_test.go b/ray-operator/apis/ray/v1alpha1/raycluster_types_test.go index 7b6bf0cb652..f3042f81ec2 100644 --- a/ray-operator/apis/ray/v1alpha1/raycluster_types_test.go +++ b/ray-operator/apis/ray/v1alpha1/raycluster_types_test.go @@ -16,7 +16,6 @@ var myRayCluster = &RayCluster{ }, Spec: RayClusterSpec{ HeadGroupSpec: HeadGroupSpec{ - Replicas: pointer.Int32Ptr(1), RayStartParams: map[string]string{ "port": "6379", "object-manager-port": "12345", diff --git a/ray-operator/apis/ray/v1alpha1/rayjob_types_test.go b/ray-operator/apis/ray/v1alpha1/rayjob_types_test.go index 2c2c10e7938..51ecfa5e9cf 100644 --- a/ray-operator/apis/ray/v1alpha1/rayjob_types_test.go +++ b/ray-operator/apis/ray/v1alpha1/rayjob_types_test.go @@ -25,7 +25,6 @@ var expectedRayJob = RayJob{ RayClusterSpec: &RayClusterSpec{ RayVersion: "1.12.1", HeadGroupSpec: HeadGroupSpec{ - Replicas: pointer.Int32Ptr(1), RayStartParams: map[string]string{ "port": "6379", "object-store-memory": "100000000", diff --git a/ray-operator/apis/ray/v1alpha1/rayservice_types_test.go b/ray-operator/apis/ray/v1alpha1/rayservice_types_test.go index 87034662625..a69e727fcfa 100644 --- a/ray-operator/apis/ray/v1alpha1/rayservice_types_test.go +++ b/ray-operator/apis/ray/v1alpha1/rayservice_types_test.go @@ -71,7 +71,6 @@ var myRayService = &RayService{ }, RayClusterSpec: RayClusterSpec{ HeadGroupSpec: HeadGroupSpec{ - Replicas: pointer.Int32Ptr(1), RayStartParams: map[string]string{ "port": "6379", "object-store-memory": "100000000", @@ -236,7 +235,6 @@ var expected = `{ }, "rayClusterConfig":{ "headGroupSpec":{ - "replicas":1, "rayStartParams":{ "dashboard-agent-listen-port":"52365", "dashboard-host":"0.0.0.0", diff --git a/ray-operator/apis/ray/v1alpha1/zz_generated.deepcopy.go b/ray-operator/apis/ray/v1alpha1/zz_generated.deepcopy.go index 9673a64fae7..b71f5f2a560 100644 --- a/ray-operator/apis/ray/v1alpha1/zz_generated.deepcopy.go +++ b/ray-operator/apis/ray/v1alpha1/zz_generated.deepcopy.go @@ -142,11 +142,6 @@ func (in *HeadGroupSpec) DeepCopyInto(out *HeadGroupSpec) { *out = new(bool) **out = **in } - if in.Replicas != nil { - in, out := &in.Replicas, &out.Replicas - *out = new(int32) - **out = **in - } if in.RayStartParams != nil { in, out := &in.RayStartParams, &out.RayStartParams *out = make(map[string]string, len(*in)) diff --git a/ray-operator/config/crd/bases/ray.io_rayclusters.yaml b/ray-operator/config/crd/bases/ray.io_rayclusters.yaml index a8238fd24e6..ec23ee7f37e 100644 --- a/ray-operator/config/crd/bases/ray.io_rayclusters.yaml +++ b/ray-operator/config/crd/bases/ray.io_rayclusters.yaml @@ -444,9 +444,6 @@ spec: additionalProperties: type: string type: object - replicas: - format: int32 - type: integer serviceType: type: string template: @@ -7120,9 +7117,6 @@ spec: additionalProperties: type: string type: object - replicas: - format: int32 - type: integer serviceType: type: string template: diff --git a/ray-operator/config/crd/bases/ray.io_rayjobs.yaml b/ray-operator/config/crd/bases/ray.io_rayjobs.yaml index 4838f17ed1f..6fa6edf8f29 100644 --- a/ray-operator/config/crd/bases/ray.io_rayjobs.yaml +++ b/ray-operator/config/crd/bases/ray.io_rayjobs.yaml @@ -443,9 +443,6 @@ spec: additionalProperties: type: string type: object - replicas: - format: int32 - type: integer serviceType: type: string template: @@ -10232,9 +10229,6 @@ spec: additionalProperties: type: string type: object - replicas: - format: int32 - type: integer serviceType: type: string template: diff --git a/ray-operator/config/crd/bases/ray.io_rayservices.yaml b/ray-operator/config/crd/bases/ray.io_rayservices.yaml index 88267a1bfea..7602ce9aa7b 100644 --- a/ray-operator/config/crd/bases/ray.io_rayservices.yaml +++ b/ray-operator/config/crd/bases/ray.io_rayservices.yaml @@ -428,9 +428,6 @@ spec: additionalProperties: type: string type: object - replicas: - format: int32 - type: integer serviceType: type: string template: @@ -7482,9 +7479,6 @@ spec: additionalProperties: type: string type: object - replicas: - format: int32 - type: integer serviceType: type: string template: diff --git a/ray-operator/controllers/ray/batchscheduler/volcano/volcano_scheduler.go b/ray-operator/controllers/ray/batchscheduler/volcano/volcano_scheduler.go index 184fa5d5477..9a807367909 100644 --- a/ray-operator/controllers/ray/batchscheduler/volcano/volcano_scheduler.go +++ b/ray-operator/controllers/ray/batchscheduler/volcano/volcano_scheduler.go @@ -52,10 +52,10 @@ func (v *VolcanoBatchScheduler) DoBatchSchedulingOnSubmission(app *rayv1.RayClus var minMember int32 var totalResource corev1.ResourceList if app.Spec.EnableInTreeAutoscaling == nil || !*app.Spec.EnableInTreeAutoscaling { - minMember = utils.CalculateDesiredReplicas(app) + *app.Spec.HeadGroupSpec.Replicas + minMember = utils.CalculateDesiredReplicas(app) + 1 totalResource = utils.CalculateDesiredResources(app) } else { - minMember = utils.CalculateMinReplicas(app) + *app.Spec.HeadGroupSpec.Replicas + minMember = utils.CalculateMinReplicas(app) + 1 totalResource = utils.CalculateMinResources(app) } diff --git a/ray-operator/controllers/ray/batchscheduler/volcano/volcano_scheduler_test.go b/ray-operator/controllers/ray/batchscheduler/volcano/volcano_scheduler_test.go index 96d0cc2d11e..1d0eb06c1c1 100644 --- a/ray-operator/controllers/ray/batchscheduler/volcano/volcano_scheduler_test.go +++ b/ray-operator/controllers/ray/batchscheduler/volcano/volcano_scheduler_test.go @@ -62,7 +62,6 @@ func TestCreatePodGroup(t *testing.T) { Template: corev1.PodTemplateSpec{ Spec: headSpec, }, - Replicas: pointer.Int32Ptr(1), }, WorkerGroupSpecs: []rayv1.WorkerGroupSpec{ { @@ -77,7 +76,7 @@ func TestCreatePodGroup(t *testing.T) { }, } - minMember := utils.CalculateDesiredReplicas(&cluster) + *cluster.Spec.HeadGroupSpec.Replicas + minMember := utils.CalculateDesiredReplicas(&cluster) + 1 totalResource := utils.CalculateDesiredResources(&cluster) pg := createPodGroup(&cluster, getAppPodGroupName(&cluster), minMember, totalResource) diff --git a/ray-operator/controllers/ray/common/ingress_test.go b/ray-operator/controllers/ray/common/ingress_test.go index cb556a44cfb..407e8f9ccbb 100644 --- a/ray-operator/controllers/ray/common/ingress_test.go +++ b/ray-operator/controllers/ray/common/ingress_test.go @@ -12,7 +12,6 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/utils/pointer" ) var instanceWithIngressEnabled = &rayv1.RayCluster{ @@ -25,7 +24,6 @@ var instanceWithIngressEnabled = &rayv1.RayCluster{ }, Spec: rayv1.RayClusterSpec{ HeadGroupSpec: rayv1.HeadGroupSpec{ - Replicas: pointer.Int32Ptr(1), Template: corev1.PodTemplateSpec{ Spec: corev1.PodSpec{ Containers: []corev1.Container{ @@ -49,7 +47,6 @@ var instanceWithIngressEnabledWithoutIngressClass = &rayv1.RayCluster{ }, Spec: rayv1.RayClusterSpec{ HeadGroupSpec: rayv1.HeadGroupSpec{ - Replicas: pointer.Int32Ptr(1), Template: corev1.PodTemplateSpec{ Spec: corev1.PodSpec{ Containers: []corev1.Container{ diff --git a/ray-operator/controllers/ray/common/pod_test.go b/ray-operator/controllers/ray/common/pod_test.go index c7d033a0827..b2bcdca935e 100644 --- a/ray-operator/controllers/ray/common/pod_test.go +++ b/ray-operator/controllers/ray/common/pod_test.go @@ -30,7 +30,6 @@ var instance = rayv1.RayCluster{ }, Spec: rayv1.RayClusterSpec{ HeadGroupSpec: rayv1.HeadGroupSpec{ - Replicas: pointer.Int32Ptr(1), RayStartParams: map[string]string{ "port": "6379", "object-manager-port": "12345", diff --git a/ray-operator/controllers/ray/common/route_test.go b/ray-operator/controllers/ray/common/route_test.go index b72802affbc..c9e7d5dc2bf 100644 --- a/ray-operator/controllers/ray/common/route_test.go +++ b/ray-operator/controllers/ray/common/route_test.go @@ -22,7 +22,6 @@ var instanceWithRouteEnabled = &rayv1.RayCluster{ }, Spec: rayv1.RayClusterSpec{ HeadGroupSpec: rayv1.HeadGroupSpec{ - Replicas: pointer.Int32Ptr(1), EnableIngress: pointer.BoolPtr(true), Template: corev1.PodTemplateSpec{ Spec: corev1.PodSpec{ diff --git a/ray-operator/controllers/ray/common/service_test.go b/ray-operator/controllers/ray/common/service_test.go index 8d023526b0b..2e6deae5a83 100644 --- a/ray-operator/controllers/ray/common/service_test.go +++ b/ray-operator/controllers/ray/common/service_test.go @@ -12,7 +12,6 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/utils/pointer" ) var ( @@ -44,7 +43,6 @@ var ( headServiceAnnotationKey2: headServiceAnnotationValue2, }, HeadGroupSpec: rayv1.HeadGroupSpec{ - Replicas: pointer.Int32Ptr(1), RayStartParams: map[string]string{ "port": "6379", "object-manager-port": "12345", diff --git a/ray-operator/controllers/ray/raycluster_controller_fake_test.go b/ray-operator/controllers/ray/raycluster_controller_fake_test.go index 0743e5fcd58..05800c829b8 100644 --- a/ray-operator/controllers/ray/raycluster_controller_fake_test.go +++ b/ray-operator/controllers/ray/raycluster_controller_fake_test.go @@ -290,7 +290,6 @@ func setupTest(t *testing.T) { Spec: rayv1.RayClusterSpec{ EnableInTreeAutoscaling: &enableInTreeAutoscaling, HeadGroupSpec: rayv1.HeadGroupSpec{ - Replicas: pointer.Int32Ptr(1), RayStartParams: map[string]string{ "port": "6379", "object-manager-port": "12345", diff --git a/ray-operator/controllers/ray/rayjob_controller_suspended_test.go b/ray-operator/controllers/ray/rayjob_controller_suspended_test.go index 5059fa5a5c0..80907622afa 100644 --- a/ray-operator/controllers/ray/rayjob_controller_suspended_test.go +++ b/ray-operator/controllers/ray/rayjob_controller_suspended_test.go @@ -58,7 +58,6 @@ var _ = Context("Inside the default namespace", func() { RayVersion: "2.7.0", HeadGroupSpec: rayv1.HeadGroupSpec{ ServiceType: corev1.ServiceTypeClusterIP, - Replicas: pointer.Int32(1), RayStartParams: map[string]string{ "port": "6379", "object-store-memory": "100000000", diff --git a/ray-operator/controllers/ray/rayjob_controller_test.go b/ray-operator/controllers/ray/rayjob_controller_test.go index 1bac798bd7c..ffb9e032b74 100644 --- a/ray-operator/controllers/ray/rayjob_controller_test.go +++ b/ray-operator/controllers/ray/rayjob_controller_test.go @@ -50,7 +50,6 @@ var myRayJob = &rayv1.RayJob{ RayClusterSpec: &rayv1.RayClusterSpec{ RayVersion: "1.12.1", HeadGroupSpec: rayv1.HeadGroupSpec{ - Replicas: pointer.Int32(1), RayStartParams: map[string]string{ "port": "6379", "object-store-memory": "100000000", diff --git a/ray-operator/controllers/ray/rayservice_controller_test.go b/ray-operator/controllers/ray/rayservice_controller_test.go index 02fde229995..0f74c251192 100644 --- a/ray-operator/controllers/ray/rayservice_controller_test.go +++ b/ray-operator/controllers/ray/rayservice_controller_test.go @@ -123,7 +123,6 @@ applications: RayClusterSpec: rayv1.RayClusterSpec{ RayVersion: "1.12.1", HeadGroupSpec: rayv1.HeadGroupSpec{ - Replicas: pointer.Int32(1), RayStartParams: map[string]string{ "port": "6379", "object-store-memory": "100000000", diff --git a/ray-operator/controllers/ray/utils/util.go b/ray-operator/controllers/ray/utils/util.go index b4ab31a0c53..0e4a4d4eba5 100644 --- a/ray-operator/controllers/ray/utils/util.go +++ b/ray-operator/controllers/ray/utils/util.go @@ -284,9 +284,7 @@ func CalculateAvailableReplicas(pods corev1.PodList) int32 { func CalculateDesiredResources(cluster *rayv1.RayCluster) corev1.ResourceList { desiredResourcesList := []corev1.ResourceList{{}} headPodResource := calculatePodResource(cluster.Spec.HeadGroupSpec.Template.Spec) - for i := int32(0); i < *cluster.Spec.HeadGroupSpec.Replicas; i++ { - desiredResourcesList = append(desiredResourcesList, headPodResource) - } + desiredResourcesList = append(desiredResourcesList, headPodResource) for _, nodeGroup := range cluster.Spec.WorkerGroupSpecs { podResource := calculatePodResource(nodeGroup.Template.Spec) for i := int32(0); i < *nodeGroup.Replicas; i++ { @@ -299,9 +297,7 @@ func CalculateDesiredResources(cluster *rayv1.RayCluster) corev1.ResourceList { func CalculateMinResources(cluster *rayv1.RayCluster) corev1.ResourceList { minResourcesList := []corev1.ResourceList{{}} headPodResource := calculatePodResource(cluster.Spec.HeadGroupSpec.Template.Spec) - for i := int32(0); i < *cluster.Spec.HeadGroupSpec.Replicas; i++ { - minResourcesList = append(minResourcesList, headPodResource) - } + minResourcesList = append(minResourcesList, headPodResource) for _, nodeGroup := range cluster.Spec.WorkerGroupSpecs { podResource := calculatePodResource(nodeGroup.Template.Spec) for i := int32(0); i < *nodeGroup.MinReplicas; i++ {