From 23aa787c1afae60599a23b813bc516021f3698e1 Mon Sep 17 00:00:00 2001 From: Mateusz Kubaczyk Date: Wed, 9 Jan 2019 16:05:15 +0100 Subject: [PATCH 1/2] Add initial_node_count var for node_pool block --- CHANGELOG.md | 1 + README.md | 23 ++++++++++++----------- cluster_regional.tf | 2 +- cluster_zonal.tf | 2 +- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 460a863df9..6dccd8f32a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ project adheres to [Semantic Versioning](http://semver.org/). * Set `horizontal_pod_autoscaling` to `true` by default. #42 * Add `remove_default_node_pool` set to `false` by default #15 * Allow arbitrary key-value pairs to be set on node pool metadata. #52 +* Add `initial_node_count` parameter to node_pool block. ## [v0.4.0] - 2018-12-19 ### Added diff --git a/README.md b/README.md index ec686e4464..e552b2b604 100644 --- a/README.md +++ b/README.md @@ -30,17 +30,18 @@ module "gke" { node_pools = [ { - name = "default-node-pool" - machine_type = "n1-standard-2" - min_count = 1 - max_count = 100 - disk_size_gb = 100 - disk_type = "pd-standard" - image_type = "COS" - auto_repair = true - auto_upgrade = true - service_account = "project-service-account@.iam.gserviceaccount.com" - preemptible = false + name = "default-node-pool" + machine_type = "n1-standard-2" + min_count = 1 + max_count = 100 + disk_size_gb = 100 + disk_type = "pd-standard" + image_type = "COS" + auto_repair = true + auto_upgrade = true + service_account = "project-service-account@.iam.gserviceaccount.com" + preemptible = false + initial_node_count = 80 }, ] diff --git a/cluster_regional.tf b/cluster_regional.tf index 057afc44dc..55e2d4fb7f 100644 --- a/cluster_regional.tf +++ b/cluster_regional.tf @@ -95,7 +95,7 @@ resource "google_container_node_pool" "pools" { region = "${var.region}" cluster = "${var.name}" version = "${lookup(var.node_pools[count.index], "auto_upgrade", false) ? "" : lookup(var.node_pools[count.index], "version", local.node_version)}" - initial_node_count = "${lookup(var.node_pools[count.index], "min_count", 1)}" + initial_node_count = "${lookup(var.node_pools[count.index], "initial_node_count", lookup(var.node_pools[count.index], "min_count", 1))}" autoscaling { min_node_count = "${lookup(var.node_pools[count.index], "min_count", 1)}" diff --git a/cluster_zonal.tf b/cluster_zonal.tf index fb4be3ff85..c25f31efda 100644 --- a/cluster_zonal.tf +++ b/cluster_zonal.tf @@ -95,7 +95,7 @@ resource "google_container_node_pool" "zonal_pools" { zone = "${var.zones[0]}" cluster = "${var.name}" version = "${lookup(var.node_pools[count.index], "auto_upgrade", false) ? "" : lookup(var.node_pools[count.index], "version", local.node_version)}" - initial_node_count = "${lookup(var.node_pools[count.index], "min_count", 1)}" + initial_node_count = "${lookup(var.node_pools[count.index], "initial_node_count", lookup(var.node_pools[count.index], "min_count", 1))}" autoscaling { min_node_count = "${lookup(var.node_pools[count.index], "min_count", 1)}" From 653a0b6290c98b6985fb738cbba9760eccc6b28d Mon Sep 17 00:00:00 2001 From: Morgante Pell Date: Wed, 9 Jan 2019 18:08:48 +0100 Subject: [PATCH 2/2] Update CHANGELOG.md Co-Authored-By: mkubaczyk --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6dccd8f32a..af0547a148 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ project adheres to [Semantic Versioning](http://semver.org/). * Set `horizontal_pod_autoscaling` to `true` by default. #42 * Add `remove_default_node_pool` set to `false` by default #15 * Allow arbitrary key-value pairs to be set on node pool metadata. #52 -* Add `initial_node_count` parameter to node_pool block. +* Add `initial_node_count` parameter to node_pool block. #60 ## [v0.4.0] - 2018-12-19 ### Added