Skip to content

Commit ae2732c

Browse files
authored
Merge branch 'main' into patch-1
2 parents da8821d + eeaf95d commit ae2732c

File tree

92 files changed

+747
-143
lines changed

Some content is hidden

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

92 files changed

+747
-143
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@ 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+
## [38.1.0](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/compare/v38.0.1...v38.1.0) (2025-08-29)
10+
11+
12+
### Features
13+
14+
* **deps:** Update Terraform Google Provider to v7 (major) ([#2425](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/2425)) ([6967a8f](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/commit/6967a8f2658073959a866b4b638c4e950802eb04))
15+
16+
17+
### Bug Fixes
18+
19+
* note org support of Identity Service for GKE ([#2422](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/2422)) ([893ba59](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/commit/893ba597d38bef0bc6a47a5d2a37c802f7ce749d))
20+
921
## [38.0.1](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/compare/v38.0.0...v38.0.1) (2025-08-22)
1022

1123

Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,13 @@ docker_test_lint:
7676
/usr/local/bin/test_lint.sh
7777

7878
# Generate documentation
79-
# Removed `display` for https://github.com/GoogleCloudPlatform/cloud-foundation-toolkit/issues/3140
8079
.PHONY: docker_generate_docs
8180
docker_generate_docs:
8281
$(DOCKER_BIN) run --rm -it \
8382
-e ENABLE_BPMETADATA=1 \
8483
-v "$(CURDIR)":/workspace \
8584
$(REGISTRY_URL)/${DOCKER_IMAGE_DEVELOPER_TOOLS}:${DOCKER_TAG_VERSION_DEVELOPER_TOOLS} \
86-
/bin/bash -c 'source /usr/local/bin/task_helper_functions.sh && generate_docs --per-module-requirements'
85+
/bin/bash -c 'source /usr/local/bin/task_helper_functions.sh && generate_docs -d --per-module-requirements'
8786

8887
# Generate files from autogen
8988
.PHONY: docker_generate_modules

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ Then perform the following commands on the root folder:
175175
| enable\_gcfs | Enable image streaming on cluster level. | `bool` | `false` | no |
176176
| enable\_identity\_service | (Optional) Enable the Identity Service component, which allows customers to use external identity providers with the K8S API. NOTE: Starting on July 1, 2025, new Google Cloud organizations that you create won't support Identity Service for GKE. | `bool` | `false` | no |
177177
| enable\_intranode\_visibility | Whether Intra-node visibility is enabled for this cluster. This makes same node pod to pod traffic visible for VPC network | `bool` | `false` | no |
178+
| enable\_k8s\_beta\_apis | (Optional) - List of Kubernetes Beta APIs to enable in cluster. | `list(string)` | `[]` | no |
178179
| enable\_kubernetes\_alpha | Whether to enable Kubernetes Alpha features for this cluster. Note that when this option is enabled, the cluster cannot be upgraded and will be automatically deleted after 30 days. | `bool` | `false` | no |
179180
| enable\_l4\_ilb\_subsetting | Enable L4 ILB Subsetting on the cluster | `bool` | `false` | no |
180181
| enable\_mesh\_certificates | Controls the issuance of workload mTLS certificates. When enabled the GKE Workload Identity Certificates controller and node agent will be deployed in the cluster. Requires Workload Identity. | `bool` | `false` | no |
@@ -250,6 +251,7 @@ Then perform the following commands on the root folder:
250251
| parallelstore\_csi\_driver | Whether the Parallelstore CSI driver Addon is enabled for this cluster. | `bool` | `null` | no |
251252
| project\_id | The project ID to host the cluster in (required) | `string` | n/a | yes |
252253
| ray\_operator\_config | The Ray Operator Addon configuration for this cluster. | <pre>object({<br> enabled = bool<br> logging_enabled = optional(bool, false)<br> monitoring_enabled = optional(bool, false)<br> })</pre> | <pre>{<br> "enabled": false,<br> "logging_enabled": false,<br> "monitoring_enabled": false<br>}</pre> | no |
254+
| rbac\_binding\_config | RBACBindingConfig allows user to restrict ClusterRoleBindings an RoleBindings that can be created. | <pre>object({<br> enable_insecure_binding_system_unauthenticated = optional(bool, null)<br> enable_insecure_binding_system_authenticated = optional(bool, null)<br> })</pre> | <pre>{<br> "enable_insecure_binding_system_authenticated": null,<br> "enable_insecure_binding_system_unauthenticated": null<br>}</pre> | no |
253255
| region | The region to host the cluster in (optional if zonal cluster / required if regional) | `string` | `null` | no |
254256
| regional | Whether is a regional cluster (zonal cluster if set false. WARNING: changing this after cluster creation is destructive!) | `bool` | `true` | no |
255257
| registry\_project\_ids | Projects holding Google Container Registries. If empty, we use the cluster project. If a service account is created and the `grant_registry_access` variable is set to `true`, the `storage.objectViewer` and `artifactregsitry.reader` roles are assigned on these projects. | `list(string)` | `[]` | no |

autogen/main/cluster.tf.tmpl

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ resource "google_container_cluster" "primary" {
3737
network = "projects/${local.network_project_id}/global/networks/${var.network}"
3838
deletion_protection = var.deletion_protection
3939

40+
dynamic "enable_k8s_beta_apis" {
41+
for_each = length(var.enable_k8s_beta_apis) > 0 ? [1] : []
42+
content {
43+
enabled_apis = var.enable_k8s_beta_apis
44+
}
45+
}
46+
4047
{% if autopilot_cluster != true %}
4148
dynamic "network_policy" {
4249
for_each = local.cluster_network_policy
@@ -274,6 +281,14 @@ resource "google_container_cluster" "primary" {
274281
}
275282
}
276283

284+
dynamic "rbac_binding_config" {
285+
for_each = var.rbac_binding_config.enable_insecure_binding_system_unauthenticated != null || var.rbac_binding_config.enable_insecure_binding_system_authenticated != null ? [var.rbac_binding_config] : []
286+
content {
287+
enable_insecure_binding_system_unauthenticated = rbac_binding_config.value["enable_insecure_binding_system_unauthenticated"]
288+
enable_insecure_binding_system_authenticated = rbac_binding_config.value["enable_insecure_binding_system_authenticated"]
289+
}
290+
}
291+
277292
dynamic "secret_manager_config" {
278293
for_each = var.enable_secret_manager_addon ? [var.enable_secret_manager_addon] : []
279294
content {
@@ -341,10 +356,20 @@ resource "google_container_cluster" "primary" {
341356

342357
{% if autopilot_cluster != true %}
343358
dynamic "node_pool_auto_config" {
344-
for_each = var.cluster_autoscaling.enabled && (length(var.network_tags) > 0 || var.add_cluster_firewall_rules) ? [1] : []
359+
for_each = var.cluster_autoscaling.enabled && (length(var.network_tags) > 0 || var.add_cluster_firewall_rules || local.node_pools_cgroup_mode != null) ? [1] : []
345360
content {
346-
network_tags {
347-
tags = var.add_cluster_firewall_rules ? (concat(var.network_tags, [local.cluster_network_tag])) : var.network_tags
361+
dynamic "network_tags" {
362+
for_each = var.cluster_autoscaling.enabled && (length(var.network_tags) > 0 || var.add_cluster_firewall_rules) ? [1] : []
363+
content {
364+
tags = var.add_cluster_firewall_rules ? (concat(var.network_tags, [local.cluster_network_tag])) : var.network_tags
365+
}
366+
}
367+
368+
dynamic "linux_node_config" {
369+
for_each = local.node_pools_cgroup_mode["all"] != "" ? [1] : []
370+
content {
371+
cgroup_mode = local.node_pools_cgroup_mode["all"]
372+
}
348373
}
349374
}
350375
}

autogen/main/variables.tf.tmpl

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,12 @@ variable "network_tags" {
399399
default = []
400400
}
401401

402+
variable "enable_k8s_beta_apis" {
403+
description = "(Optional) - List of Kubernetes Beta APIs to enable in cluster."
404+
type = list(string)
405+
default = []
406+
}
407+
402408
{% if autopilot_cluster != true %}
403409
variable "stub_domains" {
404410
type = map(list(string))
@@ -1149,3 +1155,15 @@ variable "ip_endpoints_enabled" {
11491155
type = bool
11501156
default = null
11511157
}
1158+
1159+
variable "rbac_binding_config" {
1160+
type = object({
1161+
enable_insecure_binding_system_unauthenticated = optional(bool, null)
1162+
enable_insecure_binding_system_authenticated = optional(bool, null)
1163+
})
1164+
description = "RBACBindingConfig allows user to restrict ClusterRoleBindings an RoleBindings that can be created."
1165+
default = {
1166+
enable_insecure_binding_system_unauthenticated = null
1167+
enable_insecure_binding_system_authenticated = null
1168+
}
1169+
}

autogen/main/versions.tf.tmpl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,33 +24,33 @@ terraform {
2424
required_providers {
2525
google = {
2626
source = "hashicorp/google"
27-
version = ">= 6.42.0, < 7"
27+
version = ">= 6.47.0, < 8"
2828
}
2929
google-beta = {
3030
source = "hashicorp/google-beta"
31-
version = ">= 6.42.0, < 7"
31+
version = ">= 6.47.0, < 8"
3232
}
3333
{% elif beta_cluster and autopilot_cluster %}
3434
required_providers {
3535
google = {
3636
source = "hashicorp/google"
37-
version = ">= 6.42.0, < 7"
37+
version = ">= 6.47.0, < 8"
3838
}
3939
google-beta = {
4040
source = "hashicorp/google-beta"
41-
version = ">= 6.42.0, < 7"
41+
version = ">= 6.47.0, < 8"
4242
}
4343
{% elif autopilot_cluster %}
4444
required_providers {
4545
google = {
4646
source = "hashicorp/google"
47-
version = ">= 6.42.0, < 7"
47+
version = ">= 6.47.0, < 8"
4848
}
4949
{% else %}
5050
required_providers {
5151
google = {
5252
source = "hashicorp/google"
53-
version = ">= 6.42.0, < 7"
53+
version = ">= 6.47.0, < 8"
5454
}
5555
{% endif %}
5656
kubernetes = {
@@ -63,6 +63,6 @@ terraform {
6363
}
6464
}
6565
provider_meta "{% if beta_cluster %}google-beta{% else %}google{% endif %}" {
66-
module_name = "blueprints/terraform/terraform-google-kubernetes-engine{% if module_registry_name %}:{{ module_registry_name }}{% endif %}/v38.0.1"
66+
module_name = "blueprints/terraform/terraform-google-kubernetes-engine{% if module_registry_name %}:{{ module_registry_name }}{% endif %}/v38.1.0"
6767
}
6868
}

autogen/safer-cluster/versions.tf.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ terraform {
2323
required_version = ">=1.3"
2424

2525
provider_meta "google-beta" {
26-
module_name = "blueprints/terraform/terraform-google-kubernetes-engine{% if module_registry_name %}:{{ module_registry_name }}{% endif %}/v38.0.1"
26+
module_name = "blueprints/terraform/terraform-google-kubernetes-engine{% if module_registry_name %}:{{ module_registry_name }}{% endif %}/v38.1.0"
2727
}
2828
}

cluster.tf

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@ resource "google_container_cluster" "primary" {
3333
network = "projects/${local.network_project_id}/global/networks/${var.network}"
3434
deletion_protection = var.deletion_protection
3535

36+
dynamic "enable_k8s_beta_apis" {
37+
for_each = length(var.enable_k8s_beta_apis) > 0 ? [1] : []
38+
content {
39+
enabled_apis = var.enable_k8s_beta_apis
40+
}
41+
}
42+
3643
dynamic "network_policy" {
3744
for_each = local.cluster_network_policy
3845

@@ -213,6 +220,14 @@ resource "google_container_cluster" "primary" {
213220
}
214221
}
215222

223+
dynamic "rbac_binding_config" {
224+
for_each = var.rbac_binding_config.enable_insecure_binding_system_unauthenticated != null || var.rbac_binding_config.enable_insecure_binding_system_authenticated != null ? [var.rbac_binding_config] : []
225+
content {
226+
enable_insecure_binding_system_unauthenticated = rbac_binding_config.value["enable_insecure_binding_system_unauthenticated"]
227+
enable_insecure_binding_system_authenticated = rbac_binding_config.value["enable_insecure_binding_system_authenticated"]
228+
}
229+
}
230+
216231
dynamic "secret_manager_config" {
217232
for_each = var.enable_secret_manager_addon ? [var.enable_secret_manager_addon] : []
218233
content {
@@ -250,10 +265,20 @@ resource "google_container_cluster" "primary" {
250265
}
251266

252267
dynamic "node_pool_auto_config" {
253-
for_each = var.cluster_autoscaling.enabled && (length(var.network_tags) > 0 || var.add_cluster_firewall_rules) ? [1] : []
268+
for_each = var.cluster_autoscaling.enabled && (length(var.network_tags) > 0 || var.add_cluster_firewall_rules || local.node_pools_cgroup_mode != null) ? [1] : []
254269
content {
255-
network_tags {
256-
tags = var.add_cluster_firewall_rules ? (concat(var.network_tags, [local.cluster_network_tag])) : var.network_tags
270+
dynamic "network_tags" {
271+
for_each = var.cluster_autoscaling.enabled && (length(var.network_tags) > 0 || var.add_cluster_firewall_rules) ? [1] : []
272+
content {
273+
tags = var.add_cluster_firewall_rules ? (concat(var.network_tags, [local.cluster_network_tag])) : var.network_tags
274+
}
275+
}
276+
277+
dynamic "linux_node_config" {
278+
for_each = local.node_pools_cgroup_mode["all"] != "" ? [1] : []
279+
content {
280+
cgroup_mode = local.node_pools_cgroup_mode["all"]
281+
}
257282
}
258283
}
259284
}

examples/node_pool/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ module "gke" {
163163
}
164164

165165
node_pools_cgroup_mode = {
166-
all = "CGROUP_MODE_V1"
167-
pool-01 = "CGROUP_MODE_V2"
166+
all = "CGROUP_MODE_V2"
167+
pool-01 = "CGROUP_MODE_V1"
168168
}
169169

170170
node_pools_hugepage_size_2m = {

examples/simple_regional_private/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ This example illustrates how to create a simple private cluster.
99
|------|-------------|------|---------|:--------:|
1010
| cluster\_name\_suffix | A suffix to append to the default cluster name | `string` | `""` | no |
1111
| compute\_engine\_service\_account | Service account to associate to the nodes in the cluster | `any` | n/a | yes |
12+
| enable\_k8s\_beta\_apis | K8S beta apis to enable within the cluster | `any` | n/a | yes |
1213
| ip\_range\_pods | The secondary ip range to use for pods | `any` | n/a | yes |
1314
| network | The VPC network to host the cluster in | `any` | n/a | yes |
1415
| project\_id | The project ID to host the cluster in | `any` | n/a | yes |

0 commit comments

Comments
 (0)