Skip to content

Commit 8792ffd

Browse files
authored
Merge branch 'master' into add_sandbox_config_param
2 parents 2ccc0f3 + b65204f commit 8792ffd

File tree

7 files changed

+43
-16
lines changed

7 files changed

+43
-16
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Extending the adopted spec, each change should have a link to its corresponding
1414
* Support for Intranode Visbiility (IV) and Veritical Pod Autoscaling (VPA) beta features [#216]
1515
* Support for Workload Identity beta feature [#234]
1616
* Support for Google Groups based RBAC beta feature [#217]
17+
* Support for disabling node pool autoscaling by setting `autoscaling` to `false` within the node pool variable. [#250]
1718

1819
## [v4.1.0] 2019-07-24
1920

@@ -172,6 +173,7 @@ Extending the adopted spec, each change should have a link to its corresponding
172173
[v0.2.0]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/compare/v0.1.0...v0.2.0
173174

174175
[#241]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/pull/241
176+
[#250]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/pull/250
175177
[#236]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/pull/236
176178
[#217]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/pull/217
177179
[#234]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/pull/234

autogen/cluster.tf

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,14 @@ resource "google_container_node_pool" "pools" {
231231
max_pods_per_node = lookup(var.node_pools[count.index], "max_pods_per_node", null)
232232
{% endif %}
233233

234-
autoscaling {
235-
min_node_count = lookup(var.node_pools[count.index], "min_count", 1)
236-
max_node_count = lookup(var.node_pools[count.index], "max_count", 100)
234+
node_count = lookup(var.node_pools[count.index], "autoscaling", true) ? null : lookup(var.node_pools[count.index], "min_count", 1)
235+
236+
dynamic "autoscaling" {
237+
for_each = lookup(var.node_pools[count.index], "autoscaling", true) ? [var.node_pools[count.index]] : []
238+
content {
239+
min_node_count = lookup(autoscaling.value, "min_count", 1)
240+
max_node_count = lookup(autoscaling.value, "max_count", 100)
241+
}
237242
}
238243

239244
management {

autogen/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ variable "enable_intranode_visibility" {
383383
default = false
384384
}
385385

386-
variable "enable_vertical_pod_autoscaling" {
386+
variable "enable_vertical_pod_autoscaling" {
387387
type = bool
388388
description = "Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it"
389389
default = false

cluster.tf

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,14 @@ resource "google_container_node_pool" "pools" {
142142
lookup(var.node_pools[count.index], "min_count", 1),
143143
)
144144

145-
autoscaling {
146-
min_node_count = lookup(var.node_pools[count.index], "min_count", 1)
147-
max_node_count = lookup(var.node_pools[count.index], "max_count", 100)
145+
node_count = lookup(var.node_pools[count.index], "autoscaling", true) ? null : lookup(var.node_pools[count.index], "min_count", 1)
146+
147+
dynamic "autoscaling" {
148+
for_each = lookup(var.node_pools[count.index], "autoscaling", true) ? [var.node_pools[count.index]] : []
149+
content {
150+
min_node_count = lookup(autoscaling.value, "min_count", 1)
151+
max_node_count = lookup(autoscaling.value, "max_count", 100)
152+
}
148153
}
149154

150155
management {

modules/beta-private-cluster/cluster.tf

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,14 @@ resource "google_container_node_pool" "pools" {
215215
)
216216
max_pods_per_node = lookup(var.node_pools[count.index], "max_pods_per_node", null)
217217

218-
autoscaling {
219-
min_node_count = lookup(var.node_pools[count.index], "min_count", 1)
220-
max_node_count = lookup(var.node_pools[count.index], "max_count", 100)
218+
node_count = lookup(var.node_pools[count.index], "autoscaling", true) ? null : lookup(var.node_pools[count.index], "min_count", 1)
219+
220+
dynamic "autoscaling" {
221+
for_each = lookup(var.node_pools[count.index], "autoscaling", true) ? [var.node_pools[count.index]] : []
222+
content {
223+
min_node_count = lookup(autoscaling.value, "min_count", 1)
224+
max_node_count = lookup(autoscaling.value, "max_count", 100)
225+
}
221226
}
222227

223228
management {

modules/beta-public-cluster/cluster.tf

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,14 @@ resource "google_container_node_pool" "pools" {
210210
)
211211
max_pods_per_node = lookup(var.node_pools[count.index], "max_pods_per_node", null)
212212

213-
autoscaling {
214-
min_node_count = lookup(var.node_pools[count.index], "min_count", 1)
215-
max_node_count = lookup(var.node_pools[count.index], "max_count", 100)
213+
node_count = lookup(var.node_pools[count.index], "autoscaling", true) ? null : lookup(var.node_pools[count.index], "min_count", 1)
214+
215+
dynamic "autoscaling" {
216+
for_each = lookup(var.node_pools[count.index], "autoscaling", true) ? [var.node_pools[count.index]] : []
217+
content {
218+
min_node_count = lookup(autoscaling.value, "min_count", 1)
219+
max_node_count = lookup(autoscaling.value, "max_count", 100)
220+
}
216221
}
217222

218223
management {

modules/private-cluster/cluster.tf

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,14 @@ resource "google_container_node_pool" "pools" {
147147
lookup(var.node_pools[count.index], "min_count", 1),
148148
)
149149

150-
autoscaling {
151-
min_node_count = lookup(var.node_pools[count.index], "min_count", 1)
152-
max_node_count = lookup(var.node_pools[count.index], "max_count", 100)
150+
node_count = lookup(var.node_pools[count.index], "autoscaling", true) ? null : lookup(var.node_pools[count.index], "min_count", 1)
151+
152+
dynamic "autoscaling" {
153+
for_each = lookup(var.node_pools[count.index], "autoscaling", true) ? [var.node_pools[count.index]] : []
154+
content {
155+
min_node_count = lookup(autoscaling.value, "min_count", 1)
156+
max_node_count = lookup(autoscaling.value, "max_count", 100)
157+
}
153158
}
154159

155160
management {

0 commit comments

Comments
 (0)