From 6b9d5509201d3da15bd38ac054ddf0cb9fe5e44f Mon Sep 17 00:00:00 2001 From: Denys Makogon Date: Mon, 4 Oct 2021 12:01:58 +0300 Subject: [PATCH] Fix node pool size definition (#401) * Allow zero-sized node pools * updating comment --- modules/oke/nodepools.tf | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/oke/nodepools.tf b/modules/oke/nodepools.tf index 4c63c17d..6bd6a74b 100644 --- a/modules/oke/nodepools.tf +++ b/modules/oke/nodepools.tf @@ -20,8 +20,9 @@ resource "oci_containerengine_node_pool" "nodepools" { subnet_id = var.cluster_subnets["workers"] } } - # set quantity to a minimum of 1 to allow small clusters. - size = max(1, lookup(each.value, "node_pool_size", 1)) + # We do not enforce consumers to create a node pool with a single worker node in it if no pool size was defined, + # but instead we allow zero-sized node pool allowed by OKE API. + size = max(0, lookup(each.value, "node_pool_size", 0)) } dynamic "node_shape_config" { for_each = length(regexall("Flex", lookup(each.value, "shape", "VM.Standard.E4.Flex"))) > 0 ? [1] : []