Skip to content

Commit

Permalink
Add initial_node_count variable for scaling the default node pool
Browse files Browse the repository at this point in the history
  • Loading branch information
ctrox committed May 2, 2019
1 parent 79542bc commit 4a07c76
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion cluster_regional.tf
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ resource "google_container_cluster" "primary" {
}

node_pool {
name = "default-pool"
name = "default-pool"
initial_node_count = "${var.initial_node_count}"

node_config {
service_account = "${lookup(var.node_pools[0], "service_account", local.service_account)}"
Expand Down
3 changes: 2 additions & 1 deletion cluster_zonal.tf
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ resource "google_container_cluster" "zonal_primary" {
}

node_pool {
name = "default-pool"
name = "default-pool"
initial_node_count = "${var.initial_node_count}"

node_config {
service_account = "${lookup(var.node_pools[0], "service_account", local.service_account)}"
Expand Down
5 changes: 5 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ variable "ip_range_services" {
description = "The _name_ of the secondary subnet range to use for services"
}

variable "initial_node_count" {
description = "The number of nodes to create in this cluster's default node pool."
default = 0
}

variable "remove_default_node_pool" {
description = "Remove default node pool while setting up the cluster"
default = false
Expand Down

0 comments on commit 4a07c76

Please sign in to comment.