Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial_node_count var for node_pool block #60

Merged
merged 2 commits into from
Jan 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. #60

## [v0.4.0] - 2018-12-19
### Added
Expand Down
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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@<PROJECT ID>.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@<PROJECT ID>.iam.gserviceaccount.com"
preemptible = false
initial_node_count = 80
},
]

Expand Down
2 changes: 1 addition & 1 deletion cluster_regional.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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)}"
Expand Down
2 changes: 1 addition & 1 deletion cluster_zonal.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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)}"
Expand Down