Skip to content

Commit

Permalink
Merge pull request #149 from ctrox/initial-node-count
Browse files Browse the repository at this point in the history
Add initial_node_count variable for scaling the default node pool
  • Loading branch information
aaron-lane committed Jun 4, 2019
2 parents e30ade1 + 8a3cd40 commit 88f27ee
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 6 deletions.
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

0 comments on commit 88f27ee

Please sign in to comment.