Skip to content

Commit

Permalink
Fix node pool size definition (#401)
Browse files Browse the repository at this point in the history
* Allow zero-sized node pools

* updating comment
  • Loading branch information
denismakogon authored Oct 4, 2021
1 parent 6ff481e commit 6b9d550
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions modules/oke/nodepools.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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] : []
Expand Down

0 comments on commit 6b9d550

Please sign in to comment.