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 variable for scaling the default node pool #149

Merged
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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ In either case, upgrading to module version `v1.0.0` will trigger a recreation o
| disable\_legacy\_metadata\_endpoints | Disable the /0.1/ and /v1beta1/ metadata server endpoints on the node. Changing this value will cause all node pools to be recreated. | string | `"true"` | no |
| horizontal\_pod\_autoscaling | Enable horizontal pod autoscaling addon | string | `"true"` | no |
| http\_load\_balancing | Enable httpload balancer addon | string | `"true"` | no |
| initial\_node\_count | The number of nodes to create in this cluster's default node pool. | string | `"0"` | no |
| ip\_masq\_link\_local | Whether to masquerade traffic to the link-local prefix (169.254.0.0/16). | string | `"false"` | no |
| ip\_masq\_resync\_interval | The interval at which the agent attempts to sync its ConfigMap file from the disk. | string | `"60s"` | no |
| ip\_range\_pods | The _name_ of the secondary subnet ip range to use for pods | string | n/a | yes |
Expand Down
3 changes: 2 additions & 1 deletion autogen/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 autogen/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 autogen/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
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
1 change: 1 addition & 0 deletions modules/private-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ In either case, upgrading to module version `v1.0.0` will trigger a recreation o
| enable\_private\_nodes | (Beta) Whether nodes have internal IP addresses only | string | `"false"` | no |
| horizontal\_pod\_autoscaling | Enable horizontal pod autoscaling addon | string | `"true"` | no |
| http\_load\_balancing | Enable httpload balancer addon | string | `"true"` | no |
| initial\_node\_count | The number of nodes to create in this cluster's default node pool. | string | `"0"` | no |
| ip\_masq\_link\_local | Whether to masquerade traffic to the link-local prefix (169.254.0.0/16). | string | `"false"` | no |
| ip\_masq\_resync\_interval | The interval at which the agent attempts to sync its ConfigMap file from the disk. | string | `"60s"` | no |
| ip\_range\_pods | The _name_ of the secondary subnet ip range to use for pods | string | n/a | yes |
Expand Down
3 changes: 2 additions & 1 deletion modules/private-cluster/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 modules/private-cluster/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 modules/private-cluster/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
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