Skip to content

Commit 26cb060

Browse files
authored
Merge branch 'main' into gfix1
2 parents 9a18003 + a21b51a commit 26cb060

File tree

108 files changed

+1616
-634
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+1616
-634
lines changed

.github/workflows/stale.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,21 @@ on:
2020
schedule:
2121
- cron: "0 23 * * *"
2222

23+
permissions:
24+
contents: read
25+
issues: write
26+
pull-requests: write
27+
2328
jobs:
2429
stale:
2530
if: github.repository_owner == 'GoogleCloudPlatform' || github.repository_owner == 'terraform-google-modules'
2631
runs-on: ubuntu-latest
2732
steps:
28-
- uses: actions/stale@v9
33+
- uses: actions/stale@v10
2934
with:
3035
repo-token: ${{ secrets.GITHUB_TOKEN }}
3136
stale-issue-message: 'This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days'
3237
stale-pr-message: 'This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days'
3338
exempt-issue-labels: 'triaged'
3439
exempt-pr-labels: 'dependencies,autorelease: pending'
40+
operations-per-run: 100

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
Extending the adopted spec, each change should have a link to its corresponding pull request appended.
88

9+
## [42.0.0](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/compare/v41.0.2...v42.0.0) (2025-12-04)
10+
11+
12+
### ⚠ BREAKING CHANGES
13+
14+
* making location field as required for standard cluster ([#2495](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/2495))
15+
* **gke-node-pool:** module to allow List configurations for fields ([#2496](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/2496))
16+
* support enabling default compute class in cluster autoscaler ([#2442](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/2442))
17+
18+
### Features
19+
20+
* add auto_monitoring_config in GKE managed_prometheus ([#2420](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/2420)) ([04c88e6](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/commit/04c88e647f676f23530d6cbc43e38840592aa6d1))
21+
* add network tier configuration ([#2497](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/2497)) ([873d39e](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/commit/873d39ec26e835b7ca2c7b63082ca786f9138df4))
22+
* add support for transparent huge pages configs ([#2464](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/2464)) ([8297521](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/commit/8297521f91715f262919a85d9c51d1a13af1d1d9))
23+
* support enabling default compute class in cluster autoscaler ([#2442](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/2442)) ([3569f13](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/commit/3569f13ca21a2c2b4981cd708350962050ae330c))
24+
25+
26+
### Bug Fixes
27+
28+
* additional_ip_ranges_config ([#2458](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/2458)) ([839093c](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/commit/839093c484f34c0276240bf8a299b2dc5f5602f6))
29+
* **gke-node-pool:** module to allow List configurations for fields ([#2496](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/2496)) ([dc798c1](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/commit/dc798c1dd7af055f1223915c949ac55cc23f89a4))
30+
* making location field as required for standard cluster ([#2495](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/2495)) ([5f7d53c](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/commit/5f7d53cd77dd593508856fd84472b7071bd7b779))
31+
932
## [41.0.2](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/compare/v41.0.1...v41.0.2) (2025-11-07)
1033

1134

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ Then perform the following commands on the root folder:
149149
| anonymous\_authentication\_config\_mode | Allows users to restrict or enable anonymous access to the cluster. Valid values are `ENABLED` and `LIMITED`. | `string` | `null` | no |
150150
| 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 |
151151
| boot\_disk\_kms\_key | The Customer Managed Encryption Key used to encrypt the boot disk attached to each node in the node pool, if not overridden in `node_pools`. This should be of the form projects/[KEY\_PROJECT\_ID]/locations/[LOCATION]/keyRings/[RING\_NAME]/cryptoKeys/[KEY\_NAME]. For more information about protecting resources with Cloud KMS Keys please see: https://cloud.google.com/compute/docs/disks/customer-managed-encryption | `string` | `null` | no |
152-
| 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 = optional(number)<br> max_cpu_cores = optional(number)<br> min_memory_gb = optional(number)<br> max_memory_gb = optional(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> image_type = optional(string)<br> strategy = optional(string)<br> max_surge = optional(number)<br> max_unavailable = optional(number)<br> node_pool_soak_duration = optional(string)<br> batch_soak_duration = optional(string)<br> batch_percentage = optional(number)<br> batch_node_count = optional(number)<br> enable_secure_boot = optional(bool, false)<br> enable_integrity_monitoring = optional(bool, true)<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> "enable_integrity_monitoring": true,<br> "enable_secure_boot": false,<br> "enabled": false,<br> "gpu_resources": [],<br> "image_type": "COS_CONTAINERD",<br> "max_cpu_cores": 0,<br> "max_memory_gb": 0,<br> "min_cpu_cores": 0,<br> "min_memory_gb": 0<br>}</pre> | no |
152+
| 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 = optional(number)<br> max_cpu_cores = optional(number)<br> min_memory_gb = optional(number)<br> max_memory_gb = optional(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> image_type = optional(string)<br> strategy = optional(string)<br> max_surge = optional(number)<br> max_unavailable = optional(number)<br> node_pool_soak_duration = optional(string)<br> batch_soak_duration = optional(string)<br> batch_percentage = optional(number)<br> batch_node_count = optional(number)<br> enable_secure_boot = optional(bool, false)<br> enable_integrity_monitoring = optional(bool, true)<br> enable_default_compute_class = optional(bool, false)<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> "enable_default_compute_class": false,<br> "enable_integrity_monitoring": true,<br> "enable_secure_boot": false,<br> "enabled": false,<br> "gpu_resources": [],<br> "image_type": "COS_CONTAINERD",<br> "max_cpu_cores": 0,<br> "max_memory_gb": 0,<br> "min_cpu_cores": 0,<br> "min_memory_gb": 0<br>}</pre> | no |
153153
| cluster\_dns\_domain | The suffix used for all cluster service records. | `string` | `""` | no |
154154
| cluster\_dns\_provider | Which in-cluster DNS provider should be used. PROVIDER\_UNSPECIFIED (default) or PLATFORM\_DEFAULT or CLOUD\_DNS. | `string` | `"PROVIDER_UNSPECIFIED"` | no |
155155
| 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 |
@@ -160,7 +160,6 @@ Then perform the following commands on the root folder:
160160
| create\_service\_account | Defines if service account specified to run nodes should be created. | `bool` | `true` | no |
161161
| database\_encryption | Application-layer Secrets Encryption settings. The object format is {state = string, key\_name = string}. Valid values of state are: "ENCRYPTED"; "DECRYPTED". key\_name is the name of a CloudKMS key. | `list(object({ state = string, key_name = string }))` | <pre>[<br> {<br> "key_name": "",<br> "state": "DECRYPTED"<br> }<br>]</pre> | no |
162162
| datapath\_provider | The desired datapath provider for this cluster. By default, `DATAPATH_PROVIDER_UNSPECIFIED` enables the IPTables-based kube-proxy implementation. `ADVANCED_DATAPATH` enables Dataplane-V2 feature. | `string` | `"DATAPATH_PROVIDER_UNSPECIFIED"` | no |
163-
| default\_compute\_class\_enabled | Enable Spot VMs as the default compute class for Node Auto-Provisioning | `bool` | `null` | no |
164163
| default\_max\_pods\_per\_node | The maximum number of pods to schedule per node | `number` | `110` | no |
165164
| deletion\_protection | Whether or not to allow Terraform to destroy the cluster. | `bool` | `true` | no |
166165
| description | The description of the cluster | `string` | `""` | no |
@@ -225,6 +224,7 @@ Then perform the following commands on the root folder:
225224
| maintenance\_recurrence | Frequency of the recurring maintenance window in RFC5545 format. | `string` | `""` | no |
226225
| maintenance\_start\_time | Time window specified for daily or recurring maintenance operations in RFC3339 format | `string` | `"05:00"` | no |
227226
| master\_authorized\_networks | List of master authorized networks. If none are provided, disallow external access (except the cluster node IPs, which GKE automatically whitelists). | `list(object({ cidr_block = string, display_name = string }))` | `[]` | no |
227+
| monitoring\_auto\_monitoring\_config\_scope | Whether or not to enable GKE Auto-Monitoring. Supported values include: ALL, NONE | `string` | `"NONE"` | no |
228228
| monitoring\_enable\_managed\_prometheus | Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `null` | no |
229229
| monitoring\_enable\_observability\_metrics | Whether or not the advanced datapath metrics are enabled. | `bool` | `false` | no |
230230
| monitoring\_enable\_observability\_relay | Whether or not the advanced datapath relay is enabled. | `bool` | `false` | no |
@@ -237,6 +237,7 @@ Then perform the following commands on the root folder:
237237
| network\_policy\_provider | The network policy provider. | `string` | `"CALICO"` | no |
238238
| network\_project\_id | The project ID of the shared VPC's host (for shared vpc support) | `string` | `""` | no |
239239
| network\_tags | (Optional) - List of network tags applied to autopilot and auto-provisioned node pools. | `list(string)` | `[]` | no |
240+
| network\_tier\_config | Network tier configuration for the cluster | `string` | `null` | no |
240241
| node\_metadata | Specifies how node metadata is exposed to the workload running on the node | `string` | `"GKE_METADATA"` | no |
241242
| node\_pools | List of maps containing node pools | `list(map(any))` | <pre>[<br> {<br> "name": "default-node-pool"<br> }<br>]</pre> | no |
242243
| node\_pools\_cgroup\_mode | Map of strings containing cgroup node config by node-pool name | `map(string)` | <pre>{<br> "all": "",<br> "default-node-pool": ""<br>}</pre> | no |
@@ -250,6 +251,8 @@ Then perform the following commands on the root folder:
250251
| node\_pools\_resource\_manager\_tags | Map of maps containing resource manager tags by node-pool name | `map(map(string))` | <pre>{<br> "all": {},<br> "default-node-pool": {}<br>}</pre> | no |
251252
| node\_pools\_tags | Map of lists containing node network tags by node-pool name | `map(list(string))` | <pre>{<br> "all": [],<br> "default-node-pool": []<br>}</pre> | no |
252253
| node\_pools\_taints | Map of lists containing node taints by node-pool name | `map(list(object({ key = string, value = string, effect = string })))` | <pre>{<br> "all": [],<br> "default-node-pool": []<br>}</pre> | no |
254+
| node\_pools\_transparent\_hugepage\_defrag | Map of strings containing transparent hugepage defrag node config by node-pool name | `map(string)` | <pre>{<br> "all": "",<br> "default-node-pool": ""<br>}</pre> | no |
255+
| node\_pools\_transparent\_hugepage\_enabled | Map of strings containing transparent hugepage enabled node config by node-pool name | `map(string)` | <pre>{<br> "all": "",<br> "default-node-pool": ""<br>}</pre> | no |
253256
| non\_masquerade\_cidrs | List of strings in CIDR notation that specify the IP address ranges that do not use IP masquerading. | `list(string)` | <pre>[<br> "10.0.0.0/8",<br> "172.16.0.0/12",<br> "192.168.0.0/16"<br>]</pre> | no |
254257
| notification\_config\_topic | The desired Pub/Sub topic to which notifications will be sent by GKE. Format is projects/{project}/topics/{topic}. | `string` | `""` | no |
255258
| notification\_filter\_event\_type | Choose what type of notifications you want to receive. If no filters are applied, you'll receive all notification types. Can be used to filter what notifications are sent. Accepted values are UPGRADE\_AVAILABLE\_EVENT, UPGRADE\_EVENT, and SECURITY\_BULLETIN\_EVENT. | `list(string)` | `[]` | no |

autogen/main/cluster.tf.tmpl

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,12 @@ resource "google_container_cluster" "primary" {
132132
{% if autopilot_cluster != true %}
133133
managed_prometheus {
134134
enabled = var.monitoring_enable_managed_prometheus == null ? false : var.monitoring_enable_managed_prometheus
135+
dynamic "auto_monitoring_config" {
136+
for_each = var.monitoring_enable_managed_prometheus == true && var.monitoring_auto_monitoring_config_scope != null ? [1] : []
137+
content {
138+
scope = var.monitoring_auto_monitoring_config_scope
139+
}
140+
}
135141
}
136142
advanced_datapath_observability_config {
137143
enable_metrics = var.monitoring_enable_observability_metrics
@@ -156,7 +162,7 @@ resource "google_container_cluster" "primary" {
156162

157163
cluster_autoscaling {
158164
enabled = var.cluster_autoscaling.enabled
159-
default_compute_class_enabled = var.default_compute_class_enabled
165+
default_compute_class_enabled = lookup(var.cluster_autoscaling, "enable_default_compute_class", false)
160166
dynamic "auto_provisioning_defaults" {
161167
for_each = var.cluster_autoscaling.enabled ? [1] : []
162168

@@ -561,6 +567,12 @@ resource "google_container_cluster" "primary" {
561567
pod_ipv4_range_names = additional_ip_ranges_config.value.pod_ipv4_range_names
562568
}
563569
}
570+
dynamic "network_tier_config" {
571+
for_each = var.network_tier_config != null ? [1] : []
572+
content {
573+
network_tier = var.network_tier_config
574+
}
575+
}
564576
stack_type = var.stack_type
565577
}
566578

@@ -1315,6 +1327,10 @@ resource "google_container_node_pool" "windows_pools" {
13151327
local.node_pools_linux_node_configs_sysctls[each.value["name"]],
13161328
local.node_pools_cgroup_mode["all"] == "" ? {} : { cgroup = local.node_pools_cgroup_mode["all"] },
13171329
local.node_pools_cgroup_mode[each.value["name"]] == "" ? {} : {cgroup = local.node_pools_cgroup_mode[each.value["name"]]},
1330+
local.node_pools_transparent_hugepage_enabled["all"] == "" ? {} : { transparent_hugepage_enabled = local.node_pools_transparent_hugepage_enabled["all"] },
1331+
local.node_pools_transparent_hugepage_enabled[each.value["name"]] == "" ? {} : { transparent_hugepage_enabled = local.node_pools_transparent_hugepage_enabled[each.value["name"]] },
1332+
local.node_pools_transparent_hugepage_defrag["all"] == "" ? {} : { transparent_hugepage_defrag = local.node_pools_transparent_hugepage_defrag["all"] },
1333+
local.node_pools_transparent_hugepage_defrag[each.value["name"]] == "" ? {} : { transparent_hugepage_defrag = local.node_pools_transparent_hugepage_defrag[each.value["name"]] },
13181334
local.node_pools_hugepage_size_2m["all"] == "" ? {} : { cgroup = local.node_pools_hugepage_size_2m["all"] },
13191335
local.node_pools_hugepage_size_2m[each.value["name"]] == "" ? {} : { cgroup = local.node_pools_hugepage_size_2m[each.value["name"]] },
13201336
local.node_pools_hugepage_size_1g["all"] == "" ? {} : { cgroup = local.node_pools_hugepage_size_1g["all"] },
@@ -1326,7 +1342,9 @@ resource "google_container_node_pool" "windows_pools" {
13261342
local.node_pools_linux_node_configs_sysctls["all"],
13271343
local.node_pools_linux_node_configs_sysctls[each.value["name"]]
13281344
)
1329-
cgroup_mode = try(coalesce(local.node_pools_cgroup_mode[each.value["name"]], local.node_pools_cgroup_mode["all"]), null)
1345+
cgroup_mode = try(coalesce(local.node_pools_cgroup_mode[each.value["name"]], local.node_pools_cgroup_mode["all"]), null)
1346+
transparent_hugepage_enabled = try(coalesce(local.node_pools_transparent_hugepage_enabled[each.value["name"]], local.node_pools_transparent_hugepage_enabled["all"]), null)
1347+
transparent_hugepage_defrag = try(coalesce(local.node_pools_transparent_hugepage_defrag[each.value["name"]], local.node_pools_transparent_hugepage_defrag["all"]), null)
13301348
dynamic "hugepages_config" {
13311349
for_each = length(merge(
13321350
local.node_pools_hugepage_size_2m["all"] == "" ? {} : { cgroup = local.node_pools_hugepage_size_2m["all"] },

0 commit comments

Comments
 (0)