Skip to content

Commit 606fcd2

Browse files
committed
GKE autoscaling profile is GA now
Closes #1820
1 parent 67b67f3 commit 606fcd2

File tree

11 files changed

+72
-69
lines changed

11 files changed

+72
-69
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ Then perform the following commands on the root folder:
137137
| add\_shadow\_firewall\_rules | Create GKE shadow firewall (the same as default firewall rules with firewall logs enabled). | `bool` | `false` | no |
138138
| additional\_ip\_range\_pods | List of _names_ of the additional secondary subnet ip ranges to use for pods | `list(string)` | `[]` | no |
139139
| authenticator\_security\_group | The name of the RBAC security group for use with Google security groups in Kubernetes RBAC. Group name must be in format [email protected] | `string` | `null` | no |
140-
| cluster\_autoscaling | Cluster autoscaling configuration. See [more details](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters#clusterautoscaling) | <pre>object({<br> enabled = bool<br> min_cpu_cores = number<br> max_cpu_cores = number<br> min_memory_gb = number<br> max_memory_gb = number<br> gpu_resources = list(object({ resource_type = string, minimum = number, maximum = number }))<br> auto_repair = bool<br> auto_upgrade = bool<br> disk_size = optional(number)<br> disk_type = optional(string)<br> })</pre> | <pre>{<br> "auto_repair": true,<br> "auto_upgrade": true,<br> "disk_size": 100,<br> "disk_type": "pd-standard",<br> "enabled": false,<br> "gpu_resources": [],<br> "max_cpu_cores": 0,<br> "max_memory_gb": 0,<br> "min_cpu_cores": 0,<br> "min_memory_gb": 0<br>}</pre> | no |
140+
| cluster\_autoscaling | Cluster autoscaling configuration. See [more details](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters#clusterautoscaling) | <pre>object({<br> enabled = bool<br> autoscaling_profile = string<br> min_cpu_cores = number<br> max_cpu_cores = number<br> min_memory_gb = number<br> max_memory_gb = number<br> gpu_resources = list(object({ resource_type = string, minimum = number, maximum = number }))<br> auto_repair = bool<br> auto_upgrade = bool<br> disk_size = optional(number)<br> disk_type = optional(string)<br> })</pre> | <pre>{<br> "auto_repair": true,<br> "auto_upgrade": true,<br> "autoscaling_profile": "BALANCED",<br> "disk_size": 100,<br> "disk_type": "pd-standard",<br> "enabled": false,<br> "gpu_resources": [],<br> "max_cpu_cores": 0,<br> "max_memory_gb": 0,<br> "min_cpu_cores": 0,<br> "min_memory_gb": 0<br>}</pre> | no |
141141
| cluster\_dns\_domain | The suffix used for all cluster service records. | `string` | `""` | no |
142142
| cluster\_dns\_provider | Which in-cluster DNS provider should be used. PROVIDER\_UNSPECIFIED (default) or PLATFORM\_DEFAULT or CLOUD\_DNS. | `string` | `"PROVIDER_UNSPECIFIED"` | no |
143143
| cluster\_dns\_scope | The scope of access to cluster DNS records. DNS\_SCOPE\_UNSPECIFIED (default) or CLUSTER\_SCOPE or VPC\_SCOPE. | `string` | `"DNS_SCOPE_UNSPECIFIED"` | no |

autogen/main/cluster.tf.tmpl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,7 @@ resource "google_container_cluster" "primary" {
153153
{% endif %}
154154
}
155155
}
156-
{% if beta_cluster %}
157156
autoscaling_profile = var.cluster_autoscaling.autoscaling_profile != null ? var.cluster_autoscaling.autoscaling_profile : "BALANCED"
158-
{% endif %}
159157
dynamic "resource_limits" {
160158
for_each = local.autoscaling_resource_limits
161159
content {

autogen/main/variables.tf.tmpl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,7 @@ variable "enable_resource_consumption_export" {
245245
variable "cluster_autoscaling" {
246246
type = object({
247247
enabled = bool
248-
{% if beta_cluster %}
249248
autoscaling_profile = string
250-
{% endif %}
251249
min_cpu_cores = number
252250
max_cpu_cores = number
253251
min_memory_gb = number
@@ -260,9 +258,7 @@ variable "cluster_autoscaling" {
260258
})
261259
default = {
262260
enabled = false
263-
{% if beta_cluster %}
264261
autoscaling_profile = "BALANCED"
265-
{% endif %}
266262
max_cpu_cores = 0
267263
min_cpu_cores = 0
268264
max_memory_gb = 0

cluster.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ resource "google_container_cluster" "primary" {
115115

116116
}
117117
}
118+
autoscaling_profile = var.cluster_autoscaling.autoscaling_profile != null ? var.cluster_autoscaling.autoscaling_profile : "BALANCED"
118119
dynamic "resource_limits" {
119120
for_each = local.autoscaling_resource_limits
120121
content {

modules/private-cluster-update-variant/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ Then perform the following commands on the root folder:
165165
| add\_shadow\_firewall\_rules | Create GKE shadow firewall (the same as default firewall rules with firewall logs enabled). | `bool` | `false` | no |
166166
| additional\_ip\_range\_pods | List of _names_ of the additional secondary subnet ip ranges to use for pods | `list(string)` | `[]` | no |
167167
| authenticator\_security\_group | The name of the RBAC security group for use with Google security groups in Kubernetes RBAC. Group name must be in format [email protected] | `string` | `null` | no |
168-
| cluster\_autoscaling | Cluster autoscaling configuration. See [more details](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters#clusterautoscaling) | <pre>object({<br> enabled = bool<br> min_cpu_cores = number<br> max_cpu_cores = number<br> min_memory_gb = number<br> max_memory_gb = number<br> gpu_resources = list(object({ resource_type = string, minimum = number, maximum = number }))<br> auto_repair = bool<br> auto_upgrade = bool<br> disk_size = optional(number)<br> disk_type = optional(string)<br> })</pre> | <pre>{<br> "auto_repair": true,<br> "auto_upgrade": true,<br> "disk_size": 100,<br> "disk_type": "pd-standard",<br> "enabled": false,<br> "gpu_resources": [],<br> "max_cpu_cores": 0,<br> "max_memory_gb": 0,<br> "min_cpu_cores": 0,<br> "min_memory_gb": 0<br>}</pre> | no |
168+
| cluster\_autoscaling | Cluster autoscaling configuration. See [more details](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters#clusterautoscaling) | <pre>object({<br> enabled = bool<br> autoscaling_profile = string<br> min_cpu_cores = number<br> max_cpu_cores = number<br> min_memory_gb = number<br> max_memory_gb = number<br> gpu_resources = list(object({ resource_type = string, minimum = number, maximum = number }))<br> auto_repair = bool<br> auto_upgrade = bool<br> disk_size = optional(number)<br> disk_type = optional(string)<br> })</pre> | <pre>{<br> "auto_repair": true,<br> "auto_upgrade": true,<br> "autoscaling_profile": "BALANCED",<br> "disk_size": 100,<br> "disk_type": "pd-standard",<br> "enabled": false,<br> "gpu_resources": [],<br> "max_cpu_cores": 0,<br> "max_memory_gb": 0,<br> "min_cpu_cores": 0,<br> "min_memory_gb": 0<br>}</pre> | no |
169169
| cluster\_dns\_domain | The suffix used for all cluster service records. | `string` | `""` | no |
170170
| cluster\_dns\_provider | Which in-cluster DNS provider should be used. PROVIDER\_UNSPECIFIED (default) or PLATFORM\_DEFAULT or CLOUD\_DNS. | `string` | `"PROVIDER_UNSPECIFIED"` | no |
171171
| cluster\_dns\_scope | The scope of access to cluster DNS records. DNS\_SCOPE\_UNSPECIFIED (default) or CLUSTER\_SCOPE or VPC\_SCOPE. | `string` | `"DNS_SCOPE_UNSPECIFIED"` | no |

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ resource "google_container_cluster" "primary" {
115115

116116
}
117117
}
118+
autoscaling_profile = var.cluster_autoscaling.autoscaling_profile != null ? var.cluster_autoscaling.autoscaling_profile : "BALANCED"
118119
dynamic "resource_limits" {
119120
for_each = local.autoscaling_resource_limits
120121
content {

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

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -239,28 +239,30 @@ variable "enable_resource_consumption_export" {
239239

240240
variable "cluster_autoscaling" {
241241
type = object({
242-
enabled = bool
243-
min_cpu_cores = number
244-
max_cpu_cores = number
245-
min_memory_gb = number
246-
max_memory_gb = number
247-
gpu_resources = list(object({ resource_type = string, minimum = number, maximum = number }))
248-
auto_repair = bool
249-
auto_upgrade = bool
250-
disk_size = optional(number)
251-
disk_type = optional(string)
242+
enabled = bool
243+
autoscaling_profile = string
244+
min_cpu_cores = number
245+
max_cpu_cores = number
246+
min_memory_gb = number
247+
max_memory_gb = number
248+
gpu_resources = list(object({ resource_type = string, minimum = number, maximum = number }))
249+
auto_repair = bool
250+
auto_upgrade = bool
251+
disk_size = optional(number)
252+
disk_type = optional(string)
252253
})
253254
default = {
254-
enabled = false
255-
max_cpu_cores = 0
256-
min_cpu_cores = 0
257-
max_memory_gb = 0
258-
min_memory_gb = 0
259-
gpu_resources = []
260-
auto_repair = true
261-
auto_upgrade = true
262-
disk_size = 100
263-
disk_type = "pd-standard"
255+
enabled = false
256+
autoscaling_profile = "BALANCED"
257+
max_cpu_cores = 0
258+
min_cpu_cores = 0
259+
max_memory_gb = 0
260+
min_memory_gb = 0
261+
gpu_resources = []
262+
auto_repair = true
263+
auto_upgrade = true
264+
disk_size = 100
265+
disk_type = "pd-standard"
264266
}
265267
description = "Cluster autoscaling configuration. See [more details](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters#clusterautoscaling)"
266268
}

modules/private-cluster/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ Then perform the following commands on the root folder:
143143
| add\_shadow\_firewall\_rules | Create GKE shadow firewall (the same as default firewall rules with firewall logs enabled). | `bool` | `false` | no |
144144
| additional\_ip\_range\_pods | List of _names_ of the additional secondary subnet ip ranges to use for pods | `list(string)` | `[]` | no |
145145
| authenticator\_security\_group | The name of the RBAC security group for use with Google security groups in Kubernetes RBAC. Group name must be in format [email protected] | `string` | `null` | no |
146-
| cluster\_autoscaling | Cluster autoscaling configuration. See [more details](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters#clusterautoscaling) | <pre>object({<br> enabled = bool<br> min_cpu_cores = number<br> max_cpu_cores = number<br> min_memory_gb = number<br> max_memory_gb = number<br> gpu_resources = list(object({ resource_type = string, minimum = number, maximum = number }))<br> auto_repair = bool<br> auto_upgrade = bool<br> disk_size = optional(number)<br> disk_type = optional(string)<br> })</pre> | <pre>{<br> "auto_repair": true,<br> "auto_upgrade": true,<br> "disk_size": 100,<br> "disk_type": "pd-standard",<br> "enabled": false,<br> "gpu_resources": [],<br> "max_cpu_cores": 0,<br> "max_memory_gb": 0,<br> "min_cpu_cores": 0,<br> "min_memory_gb": 0<br>}</pre> | no |
146+
| cluster\_autoscaling | Cluster autoscaling configuration. See [more details](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters#clusterautoscaling) | <pre>object({<br> enabled = bool<br> autoscaling_profile = string<br> min_cpu_cores = number<br> max_cpu_cores = number<br> min_memory_gb = number<br> max_memory_gb = number<br> gpu_resources = list(object({ resource_type = string, minimum = number, maximum = number }))<br> auto_repair = bool<br> auto_upgrade = bool<br> disk_size = optional(number)<br> disk_type = optional(string)<br> })</pre> | <pre>{<br> "auto_repair": true,<br> "auto_upgrade": true,<br> "autoscaling_profile": "BALANCED",<br> "disk_size": 100,<br> "disk_type": "pd-standard",<br> "enabled": false,<br> "gpu_resources": [],<br> "max_cpu_cores": 0,<br> "max_memory_gb": 0,<br> "min_cpu_cores": 0,<br> "min_memory_gb": 0<br>}</pre> | no |
147147
| cluster\_dns\_domain | The suffix used for all cluster service records. | `string` | `""` | no |
148148
| cluster\_dns\_provider | Which in-cluster DNS provider should be used. PROVIDER\_UNSPECIFIED (default) or PLATFORM\_DEFAULT or CLOUD\_DNS. | `string` | `"PROVIDER_UNSPECIFIED"` | no |
149149
| cluster\_dns\_scope | The scope of access to cluster DNS records. DNS\_SCOPE\_UNSPECIFIED (default) or CLUSTER\_SCOPE or VPC\_SCOPE. | `string` | `"DNS_SCOPE_UNSPECIFIED"` | no |

modules/private-cluster/cluster.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ resource "google_container_cluster" "primary" {
115115

116116
}
117117
}
118+
autoscaling_profile = var.cluster_autoscaling.autoscaling_profile != null ? var.cluster_autoscaling.autoscaling_profile : "BALANCED"
118119
dynamic "resource_limits" {
119120
for_each = local.autoscaling_resource_limits
120121
content {

modules/private-cluster/variables.tf

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -239,28 +239,30 @@ variable "enable_resource_consumption_export" {
239239

240240
variable "cluster_autoscaling" {
241241
type = object({
242-
enabled = bool
243-
min_cpu_cores = number
244-
max_cpu_cores = number
245-
min_memory_gb = number
246-
max_memory_gb = number
247-
gpu_resources = list(object({ resource_type = string, minimum = number, maximum = number }))
248-
auto_repair = bool
249-
auto_upgrade = bool
250-
disk_size = optional(number)
251-
disk_type = optional(string)
242+
enabled = bool
243+
autoscaling_profile = string
244+
min_cpu_cores = number
245+
max_cpu_cores = number
246+
min_memory_gb = number
247+
max_memory_gb = number
248+
gpu_resources = list(object({ resource_type = string, minimum = number, maximum = number }))
249+
auto_repair = bool
250+
auto_upgrade = bool
251+
disk_size = optional(number)
252+
disk_type = optional(string)
252253
})
253254
default = {
254-
enabled = false
255-
max_cpu_cores = 0
256-
min_cpu_cores = 0
257-
max_memory_gb = 0
258-
min_memory_gb = 0
259-
gpu_resources = []
260-
auto_repair = true
261-
auto_upgrade = true
262-
disk_size = 100
263-
disk_type = "pd-standard"
255+
enabled = false
256+
autoscaling_profile = "BALANCED"
257+
max_cpu_cores = 0
258+
min_cpu_cores = 0
259+
max_memory_gb = 0
260+
min_memory_gb = 0
261+
gpu_resources = []
262+
auto_repair = true
263+
auto_upgrade = true
264+
disk_size = 100
265+
disk_type = "pd-standard"
264266
}
265267
description = "Cluster autoscaling configuration. See [more details](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters#clusterautoscaling)"
266268
}

variables.tf

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -239,28 +239,30 @@ variable "enable_resource_consumption_export" {
239239

240240
variable "cluster_autoscaling" {
241241
type = object({
242-
enabled = bool
243-
min_cpu_cores = number
244-
max_cpu_cores = number
245-
min_memory_gb = number
246-
max_memory_gb = number
247-
gpu_resources = list(object({ resource_type = string, minimum = number, maximum = number }))
248-
auto_repair = bool
249-
auto_upgrade = bool
250-
disk_size = optional(number)
251-
disk_type = optional(string)
242+
enabled = bool
243+
autoscaling_profile = string
244+
min_cpu_cores = number
245+
max_cpu_cores = number
246+
min_memory_gb = number
247+
max_memory_gb = number
248+
gpu_resources = list(object({ resource_type = string, minimum = number, maximum = number }))
249+
auto_repair = bool
250+
auto_upgrade = bool
251+
disk_size = optional(number)
252+
disk_type = optional(string)
252253
})
253254
default = {
254-
enabled = false
255-
max_cpu_cores = 0
256-
min_cpu_cores = 0
257-
max_memory_gb = 0
258-
min_memory_gb = 0
259-
gpu_resources = []
260-
auto_repair = true
261-
auto_upgrade = true
262-
disk_size = 100
263-
disk_type = "pd-standard"
255+
enabled = false
256+
autoscaling_profile = "BALANCED"
257+
max_cpu_cores = 0
258+
min_cpu_cores = 0
259+
max_memory_gb = 0
260+
min_memory_gb = 0
261+
gpu_resources = []
262+
auto_repair = true
263+
auto_upgrade = true
264+
disk_size = 100
265+
disk_type = "pd-standard"
264266
}
265267
description = "Cluster autoscaling configuration. See [more details](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters#clusterautoscaling)"
266268
}

0 commit comments

Comments
 (0)