Skip to content

Commit 35e4445

Browse files
Tolseenaveen230
authored andcommitted
feat!: promote gke_backup_agent_config to ga (terraform-google-modules#1513)
1 parent 966135f commit 35e4445

File tree

29 files changed

+118
-10
lines changed

29 files changed

+118
-10
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ Then perform the following commands on the root folder:
131131
| add\_master\_webhook\_firewall\_rules | Create master\_webhook firewall rules for ports defined in `firewall_inbound_ports` | `bool` | `false` | no |
132132
| add\_shadow\_firewall\_rules | Create GKE shadow firewall (the same as default firewall rules with firewall logs enabled). | `bool` | `false` | no |
133133
| 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 |
134-
| 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> })</pre> | <pre>{<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 |
134+
| 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> })</pre> | <pre>{<br> "auto_repair": true,<br> "auto_upgrade": true,<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 |
135135
| cluster\_dns\_domain | The suffix used for all cluster service records. | `string` | `""` | no |
136136
| cluster\_dns\_provider | Which in-cluster DNS provider should be used. PROVIDER\_UNSPECIFIED (default) or PLATFORM\_DEFAULT or CLOUD\_DNS. | `string` | `"PROVIDER_UNSPECIFIED"` | no |
137137
| 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: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,14 @@ resource "google_container_cluster" "primary" {
151151
maximum = lookup(resource_limits.value, "maximum")
152152
}
153153
}
154+
dynamic "management" {
155+
for_each = var.cluster_autoscaling.enabled ? [1] : []
156+
157+
content {
158+
auto_repair = var.cluster_autoscaling.auto_repair
159+
auto_upgrade = var.cluster_autoscaling.auto_upgrade
160+
}
161+
}
154162
}
155163
{% endif %}
156164
{% if autopilot_cluster == true %}

autogen/main/main.tf.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ locals {
6868
resource_type = "memory"
6969
minimum = var.cluster_autoscaling.min_memory_gb
7070
maximum = var.cluster_autoscaling.max_memory_gb
71-
}], var.cluster_autoscaling.gpu_resources) : []
71+
}], var.cluster_autoscaling.gpu_resources) : []
7272
{% endif %}
7373

7474

autogen/main/variables.tf.tmpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,8 @@ variable "cluster_autoscaling" {
241241
min_memory_gb = number
242242
max_memory_gb = number
243243
gpu_resources = list(object({ resource_type = string, minimum = number, maximum = number }))
244+
auto_repair = bool
245+
auto_upgrade = bool
244246
})
245247
default = {
246248
enabled = false
@@ -252,6 +254,8 @@ variable "cluster_autoscaling" {
252254
max_memory_gb = 0
253255
min_memory_gb = 0
254256
gpu_resources = []
257+
auto_repair = true
258+
auto_upgrade = true
255259
}
256260
description = "Cluster autoscaling configuration. See [more details](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters#clusterautoscaling)"
257261
}

autogen/safer-cluster/variables.tf.tmpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,8 @@ variable "cluster_autoscaling" {
227227
min_memory_gb = number
228228
max_memory_gb = number
229229
gpu_resources = list(object({ resource_type = string, minimum = number, maximum = number }))
230+
auto_repair = bool
231+
auto_upgrade = bool
230232
})
231233
default = {
232234
enabled = false
@@ -236,6 +238,8 @@ variable "cluster_autoscaling" {
236238
max_memory_gb = 0
237239
min_memory_gb = 0
238240
gpu_resources = []
241+
auto_repair = true
242+
auto_upgrade = true
239243
}
240244
description = "Cluster autoscaling configuration. See [more details](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters#clusterautoscaling)"
241245
}

cluster.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,14 @@ resource "google_container_cluster" "primary" {
114114
maximum = lookup(resource_limits.value, "maximum")
115115
}
116116
}
117+
dynamic "management" {
118+
for_each = var.cluster_autoscaling.enabled ? [1] : []
119+
120+
content {
121+
auto_repair = var.cluster_autoscaling.auto_repair
122+
auto_upgrade = var.cluster_autoscaling.auto_upgrade
123+
}
124+
}
117125
}
118126
vertical_pod_autoscaling {
119127
enabled = var.enable_vertical_pod_autoscaling

modules/beta-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
| 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 |
166166
| cloudrun | (Beta) Enable CloudRun addon | `bool` | `false` | no |
167167
| cloudrun\_load\_balancer\_type | (Beta) Configure the Cloud Run load balancer type. External by default. Set to `LOAD_BALANCER_TYPE_INTERNAL` to configure as an internal load balancer. | `string` | `""` | 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> })</pre> | <pre>{<br> "autoscaling_profile": "BALANCED",<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> })</pre> | <pre>{<br> "auto_repair": true,<br> "auto_upgrade": true,<br> "autoscaling_profile": "BALANCED",<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/beta-private-cluster-update-variant/cluster.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,14 @@ resource "google_container_cluster" "primary" {
128128
maximum = lookup(resource_limits.value, "maximum")
129129
}
130130
}
131+
dynamic "management" {
132+
for_each = var.cluster_autoscaling.enabled ? [1] : []
133+
134+
content {
135+
auto_repair = var.cluster_autoscaling.auto_repair
136+
auto_upgrade = var.cluster_autoscaling.auto_upgrade
137+
}
138+
}
131139
}
132140
vertical_pod_autoscaling {
133141
enabled = var.enable_vertical_pod_autoscaling

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,8 @@ variable "cluster_autoscaling" {
234234
min_memory_gb = number
235235
max_memory_gb = number
236236
gpu_resources = list(object({ resource_type = string, minimum = number, maximum = number }))
237+
auto_repair = bool
238+
auto_upgrade = bool
237239
})
238240
default = {
239241
enabled = false
@@ -243,6 +245,8 @@ variable "cluster_autoscaling" {
243245
max_memory_gb = 0
244246
min_memory_gb = 0
245247
gpu_resources = []
248+
auto_repair = true
249+
auto_upgrade = true
246250
}
247251
description = "Cluster autoscaling configuration. See [more details](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters#clusterautoscaling)"
248252
}

modules/beta-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
| 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 |
144144
| cloudrun | (Beta) Enable CloudRun addon | `bool` | `false` | no |
145145
| cloudrun\_load\_balancer\_type | (Beta) Configure the Cloud Run load balancer type. External by default. Set to `LOAD_BALANCER_TYPE_INTERNAL` to configure as an internal load balancer. | `string` | `""` | 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> })</pre> | <pre>{<br> "autoscaling_profile": "BALANCED",<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> })</pre> | <pre>{<br> "auto_repair": true,<br> "auto_upgrade": true,<br> "autoscaling_profile": "BALANCED",<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/beta-private-cluster/cluster.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,14 @@ resource "google_container_cluster" "primary" {
128128
maximum = lookup(resource_limits.value, "maximum")
129129
}
130130
}
131+
dynamic "management" {
132+
for_each = var.cluster_autoscaling.enabled ? [1] : []
133+
134+
content {
135+
auto_repair = var.cluster_autoscaling.auto_repair
136+
auto_upgrade = var.cluster_autoscaling.auto_upgrade
137+
}
138+
}
131139
}
132140
vertical_pod_autoscaling {
133141
enabled = var.enable_vertical_pod_autoscaling

modules/beta-private-cluster/variables.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,8 @@ variable "cluster_autoscaling" {
234234
min_memory_gb = number
235235
max_memory_gb = number
236236
gpu_resources = list(object({ resource_type = string, minimum = number, maximum = number }))
237+
auto_repair = bool
238+
auto_upgrade = bool
237239
})
238240
default = {
239241
enabled = false
@@ -243,6 +245,8 @@ variable "cluster_autoscaling" {
243245
max_memory_gb = 0
244246
min_memory_gb = 0
245247
gpu_resources = []
248+
auto_repair = true
249+
auto_upgrade = true
246250
}
247251
description = "Cluster autoscaling configuration. See [more details](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters#clusterautoscaling)"
248252
}

modules/beta-public-cluster-update-variant/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ Then perform the following commands on the root folder:
159159
| 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 |
160160
| cloudrun | (Beta) Enable CloudRun addon | `bool` | `false` | no |
161161
| cloudrun\_load\_balancer\_type | (Beta) Configure the Cloud Run load balancer type. External by default. Set to `LOAD_BALANCER_TYPE_INTERNAL` to configure as an internal load balancer. | `string` | `""` | no |
162-
| 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> })</pre> | <pre>{<br> "autoscaling_profile": "BALANCED",<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 |
162+
| 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> })</pre> | <pre>{<br> "auto_repair": true,<br> "auto_upgrade": true,<br> "autoscaling_profile": "BALANCED",<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 |
163163
| cluster\_dns\_domain | The suffix used for all cluster service records. | `string` | `""` | no |
164164
| cluster\_dns\_provider | Which in-cluster DNS provider should be used. PROVIDER\_UNSPECIFIED (default) or PLATFORM\_DEFAULT or CLOUD\_DNS. | `string` | `"PROVIDER_UNSPECIFIED"` | no |
165165
| 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/beta-public-cluster-update-variant/cluster.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,14 @@ resource "google_container_cluster" "primary" {
128128
maximum = lookup(resource_limits.value, "maximum")
129129
}
130130
}
131+
dynamic "management" {
132+
for_each = var.cluster_autoscaling.enabled ? [1] : []
133+
134+
content {
135+
auto_repair = var.cluster_autoscaling.auto_repair
136+
auto_upgrade = var.cluster_autoscaling.auto_upgrade
137+
}
138+
}
131139
}
132140
vertical_pod_autoscaling {
133141
enabled = var.enable_vertical_pod_autoscaling

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,8 @@ variable "cluster_autoscaling" {
234234
min_memory_gb = number
235235
max_memory_gb = number
236236
gpu_resources = list(object({ resource_type = string, minimum = number, maximum = number }))
237+
auto_repair = bool
238+
auto_upgrade = bool
237239
})
238240
default = {
239241
enabled = false
@@ -243,6 +245,8 @@ variable "cluster_autoscaling" {
243245
max_memory_gb = 0
244246
min_memory_gb = 0
245247
gpu_resources = []
248+
auto_repair = true
249+
auto_upgrade = true
246250
}
247251
description = "Cluster autoscaling configuration. See [more details](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters#clusterautoscaling)"
248252
}

modules/beta-public-cluster/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
| 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 |
138138
| cloudrun | (Beta) Enable CloudRun addon | `bool` | `false` | no |
139139
| cloudrun\_load\_balancer\_type | (Beta) Configure the Cloud Run load balancer type. External by default. Set to `LOAD_BALANCER_TYPE_INTERNAL` to configure as an internal load balancer. | `string` | `""` | 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> })</pre> | <pre>{<br> "autoscaling_profile": "BALANCED",<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> })</pre> | <pre>{<br> "auto_repair": true,<br> "auto_upgrade": true,<br> "autoscaling_profile": "BALANCED",<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 |

modules/beta-public-cluster/cluster.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,14 @@ resource "google_container_cluster" "primary" {
128128
maximum = lookup(resource_limits.value, "maximum")
129129
}
130130
}
131+
dynamic "management" {
132+
for_each = var.cluster_autoscaling.enabled ? [1] : []
133+
134+
content {
135+
auto_repair = var.cluster_autoscaling.auto_repair
136+
auto_upgrade = var.cluster_autoscaling.auto_upgrade
137+
}
138+
}
131139
}
132140
vertical_pod_autoscaling {
133141
enabled = var.enable_vertical_pod_autoscaling

0 commit comments

Comments
 (0)