Skip to content

Commit 2e4f36a

Browse files
authored
feat: Enable vertical autoscaling in GA modules (#758)
1 parent 753f9c7 commit 2e4f36a

File tree

19 files changed

+83
-50
lines changed

19 files changed

+83
-50
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ Then perform the following commands on the root folder:
129129
| enable\_network\_egress\_export | Whether to enable network egress metering for this cluster. If enabled, a daemonset will be created in the cluster to meter network egress traffic. | `bool` | `false` | no |
130130
| enable\_resource\_consumption\_export | Whether to enable resource consumption metering on this cluster. When enabled, a table will be created in the resource export BigQuery dataset to store resource consumption data. The resulting table can be joined with the resource usage table or with BigQuery billing export. | `bool` | `true` | no |
131131
| enable\_shielded\_nodes | Enable Shielded Nodes features on all nodes in this cluster | `bool` | `true` | no |
132+
| enable\_vertical\_pod\_autoscaling | Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it | `bool` | `false` | no |
132133
| firewall\_inbound\_ports | List of TCP ports for admission/webhook controllers | `list(string)` | <pre>[<br> "8443",<br> "9443",<br> "15017"<br>]</pre> | no |
133134
| firewall\_priority | Priority rule for firewall rules | `number` | `1000` | no |
134135
| gcloud\_upgrade | Whether to upgrade gcloud at runtime | `bool` | `false` | no |

autogen/main/cluster.tf.tmpl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ resource "google_container_cluster" "primary" {
9090
}
9191
}
9292
}
93+
94+
vertical_pod_autoscaling {
95+
enabled = var.enable_vertical_pod_autoscaling
96+
}
9397

9498
default_max_pods_per_node = var.default_max_pods_per_node
9599

@@ -99,10 +103,6 @@ resource "google_container_cluster" "primary" {
99103
enable_intranode_visibility = var.enable_intranode_visibility
100104
enable_kubernetes_alpha = var.enable_kubernetes_alpha
101105

102-
vertical_pod_autoscaling {
103-
enabled = var.enable_vertical_pod_autoscaling
104-
}
105-
106106
dynamic "pod_security_policy_config" {
107107
for_each = var.enable_pod_security_policy ? [var.enable_pod_security_policy] : []
108108
content {

autogen/main/variables.tf.tmpl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ variable "master_authorized_networks" {
7878
default = []
7979
}
8080

81+
variable "enable_vertical_pod_autoscaling" {
82+
type = bool
83+
description = "Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it"
84+
default = false
85+
}
86+
8187
variable "horizontal_pod_autoscaling" {
8288
type = bool
8389
description = "Enable horizontal pod autoscaling addon"
@@ -485,12 +491,6 @@ variable "enable_intranode_visibility" {
485491
default = false
486492
}
487493

488-
variable "enable_vertical_pod_autoscaling" {
489-
type = bool
490-
description = "Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it"
491-
default = false
492-
}
493-
494494
variable "authenticator_security_group" {
495495
type = string
496496
description = "The name of the RBAC security group for use with Google security groups in Kubernetes RBAC. Group name must be in format [email protected]"

cluster.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ resource "google_container_cluster" "primary" {
6868
}
6969
}
7070

71+
vertical_pod_autoscaling {
72+
enabled = var.enable_vertical_pod_autoscaling
73+
}
74+
7175
default_max_pods_per_node = var.default_max_pods_per_node
7276

7377
enable_shielded_nodes = var.enable_shielded_nodes

modules/beta-private-cluster-update-variant/cluster.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,17 @@ resource "google_container_cluster" "primary" {
7878
}
7979
}
8080

81+
vertical_pod_autoscaling {
82+
enabled = var.enable_vertical_pod_autoscaling
83+
}
84+
8185
default_max_pods_per_node = var.default_max_pods_per_node
8286

8387
enable_shielded_nodes = var.enable_shielded_nodes
8488
enable_binary_authorization = var.enable_binary_authorization
8589
enable_intranode_visibility = var.enable_intranode_visibility
8690
enable_kubernetes_alpha = var.enable_kubernetes_alpha
8791

88-
vertical_pod_autoscaling {
89-
enabled = var.enable_vertical_pod_autoscaling
90-
}
91-
9292
dynamic "pod_security_policy_config" {
9393
for_each = var.enable_pod_security_policy ? [var.enable_pod_security_policy] : []
9494
content {

modules/beta-private-cluster-update-variant/variables.tf

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ variable "master_authorized_networks" {
7878
default = []
7979
}
8080

81+
variable "enable_vertical_pod_autoscaling" {
82+
type = bool
83+
description = "Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it"
84+
default = false
85+
}
86+
8187
variable "horizontal_pod_autoscaling" {
8288
type = bool
8389
description = "Enable horizontal pod autoscaling addon"
@@ -470,12 +476,6 @@ variable "enable_intranode_visibility" {
470476
default = false
471477
}
472478

473-
variable "enable_vertical_pod_autoscaling" {
474-
type = bool
475-
description = "Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it"
476-
default = false
477-
}
478-
479479
variable "authenticator_security_group" {
480480
type = string
481481
description = "The name of the RBAC security group for use with Google security groups in Kubernetes RBAC. Group name must be in format [email protected]"

modules/beta-private-cluster/cluster.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,17 @@ resource "google_container_cluster" "primary" {
7878
}
7979
}
8080

81+
vertical_pod_autoscaling {
82+
enabled = var.enable_vertical_pod_autoscaling
83+
}
84+
8185
default_max_pods_per_node = var.default_max_pods_per_node
8286

8387
enable_shielded_nodes = var.enable_shielded_nodes
8488
enable_binary_authorization = var.enable_binary_authorization
8589
enable_intranode_visibility = var.enable_intranode_visibility
8690
enable_kubernetes_alpha = var.enable_kubernetes_alpha
8791

88-
vertical_pod_autoscaling {
89-
enabled = var.enable_vertical_pod_autoscaling
90-
}
91-
9292
dynamic "pod_security_policy_config" {
9393
for_each = var.enable_pod_security_policy ? [var.enable_pod_security_policy] : []
9494
content {

modules/beta-private-cluster/variables.tf

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ variable "master_authorized_networks" {
7878
default = []
7979
}
8080

81+
variable "enable_vertical_pod_autoscaling" {
82+
type = bool
83+
description = "Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it"
84+
default = false
85+
}
86+
8187
variable "horizontal_pod_autoscaling" {
8288
type = bool
8389
description = "Enable horizontal pod autoscaling addon"
@@ -470,12 +476,6 @@ variable "enable_intranode_visibility" {
470476
default = false
471477
}
472478

473-
variable "enable_vertical_pod_autoscaling" {
474-
type = bool
475-
description = "Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it"
476-
default = false
477-
}
478-
479479
variable "authenticator_security_group" {
480480
type = string
481481
description = "The name of the RBAC security group for use with Google security groups in Kubernetes RBAC. Group name must be in format [email protected]"

modules/beta-public-cluster-update-variant/cluster.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,17 @@ resource "google_container_cluster" "primary" {
7878
}
7979
}
8080

81+
vertical_pod_autoscaling {
82+
enabled = var.enable_vertical_pod_autoscaling
83+
}
84+
8185
default_max_pods_per_node = var.default_max_pods_per_node
8286

8387
enable_shielded_nodes = var.enable_shielded_nodes
8488
enable_binary_authorization = var.enable_binary_authorization
8589
enable_intranode_visibility = var.enable_intranode_visibility
8690
enable_kubernetes_alpha = var.enable_kubernetes_alpha
8791

88-
vertical_pod_autoscaling {
89-
enabled = var.enable_vertical_pod_autoscaling
90-
}
91-
9292
dynamic "pod_security_policy_config" {
9393
for_each = var.enable_pod_security_policy ? [var.enable_pod_security_policy] : []
9494
content {

modules/beta-public-cluster-update-variant/variables.tf

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ variable "master_authorized_networks" {
7878
default = []
7979
}
8080

81+
variable "enable_vertical_pod_autoscaling" {
82+
type = bool
83+
description = "Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it"
84+
default = false
85+
}
86+
8187
variable "horizontal_pod_autoscaling" {
8288
type = bool
8389
description = "Enable horizontal pod autoscaling addon"
@@ -439,12 +445,6 @@ variable "enable_intranode_visibility" {
439445
default = false
440446
}
441447

442-
variable "enable_vertical_pod_autoscaling" {
443-
type = bool
444-
description = "Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it"
445-
default = false
446-
}
447-
448448
variable "authenticator_security_group" {
449449
type = string
450450
description = "The name of the RBAC security group for use with Google security groups in Kubernetes RBAC. Group name must be in format [email protected]"

0 commit comments

Comments
 (0)