From d2b0e3a8f542fcfaac3bec459264b6b20b96a619 Mon Sep 17 00:00:00 2001 From: Sivaanand Murugesan Date: Wed, 6 Dec 2023 09:43:54 +0530 Subject: [PATCH] PLT-869:By default setting min and max to 0 for eks cluster (#82) * PLT-896:By default setting min and max to 0 for eks cluster * set min max default to 0 --- spectro-cluster-eks.tf | 5 +++-- spectro-cluster-maas.tf | 4 ++-- spectro-cluster-tke.tf | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/spectro-cluster-eks.tf b/spectro-cluster-eks.tf index 2b54e6f..3d079e1 100644 --- a/spectro-cluster-eks.tf +++ b/spectro-cluster-eks.tf @@ -132,8 +132,9 @@ resource "spectrocloud_cluster_eks" "this" { name = machine_pool.value.name update_strategy = try(machine_pool.value.update_strategy, "RollingUpdateScaleOut") count = machine_pool.value.count - min = try(machine_pool.value.min, machine_pool.value.count) # It is possible for the chosen max to be lesser than the min, or for the count to be out of bounds of min or max. Handle these conditions in the provider for this module or as input validation prior to using this module. - max = try(machine_pool.value.max, machine_pool.value.count) + # The min and max settings for EKS will only be taken into account if the autoscaler pack is added to the cluster. By default, both min and max values are set to 0. To activate autoscaling, assign the desired sizes to both the minimum and maximum settings. + min = try(machine_pool.value.min, 0) + max = try(machine_pool.value.max, 0) capacity_type = try(machine_pool.value.capacity_type, "on-demand") instance_type = machine_pool.value.instance_type az_subnets = can(machine_pool.value.worker_subnets) ? machine_pool.value.worker_subnets : null diff --git a/spectro-cluster-maas.tf b/spectro-cluster-maas.tf index eedad8e..a2aff08 100644 --- a/spectro-cluster-maas.tf +++ b/spectro-cluster-maas.tf @@ -125,8 +125,8 @@ resource "spectrocloud_cluster_maas" "this" { control_plane = try(machine_pool.value.control_plane, false) control_plane_as_worker = try(machine_pool.value.control_plane_as_worker, false) count = machine_pool.value.count - min = try(machine_pool.value.min, machine_pool.value.count) # It is possible for the chosen max to be lesser than the min, or for the count to be out of bounds of min or max. Handle these conditions in the provider for this module or as input validation prior to using this module. - max = try(machine_pool.value.max, machine_pool.value.count) + min = try(machine_pool.value.min, 0) + max = try(machine_pool.value.max, 0) node_repave_interval = can(machine_pool.value.node_repave_interval) ? machine_pool.value.node_repave_interval : null update_strategy = try(machine_pool.value.update_strategy, "RollingUpdateScaleOut") diff --git a/spectro-cluster-tke.tf b/spectro-cluster-tke.tf index 6744649..53fedde 100644 --- a/spectro-cluster-tke.tf +++ b/spectro-cluster-tke.tf @@ -127,8 +127,8 @@ resource "spectrocloud_cluster_tke" "this" { content { name = machine_pool.value.name count = machine_pool.value.count - min = try(machine_pool.value.min, machine_pool.value.count) - max = try(machine_pool.value.max, machine_pool.value.count) + min = try(machine_pool.value.min, 0) + max = try(machine_pool.value.max, 0) instance_type = machine_pool.value.instance_type az_subnets = machine_pool.value.worker_subnets disk_size_gb = machine_pool.value.disk_size_gb