Skip to content

Commit 5ae737f

Browse files
authored
Merge branch 'master' into feature/autopilot-logging-variant
2 parents 0a36d7f + 5c58d89 commit 5ae737f

File tree

144 files changed

+2768
-453
lines changed

Some content is hidden

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

144 files changed

+2768
-453
lines changed

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,24 @@ 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+
## [31.1.0](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/compare/v31.0.0...v31.1.0) (2024-06-26)
10+
11+
12+
### Features
13+
14+
* Add enable_cilium_clusterwide_network_policy support ([#1972](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/1972)) ([72cf873](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/commit/72cf8732fa05964596f9f266dd34217803e2c0cc))
15+
* Add enable_l4_ilb_subsetting for autopilot clusters ([#1969](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/1969)) ([c48dc6e](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/commit/c48dc6eb00f475ab4f213549a503da5434a7e926))
16+
* add pod_pids_limit for kubelet_config in all modules, example and autogen ([#1922](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/1922)) ([eec38a2](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/commit/eec38a2de73d637b5871881e0a3335f0e4a2f413))
17+
* Adding extra permissions to the cluster's default service account ([#1943](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/1943)) ([4fab404](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/commit/4fab404c2f63abcd5070b922edd024e24d8294b9))
18+
* Set boot_disk_kms_key cluster wide and for cluster_autoscaling ([#1959](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/1959)) ([654868e](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/commit/654868e292a68fbc0f5ef7dd4bf50336fa8efc48))
19+
20+
21+
### Bug Fixes
22+
23+
* avoid `auto_provisioning_defaults` drift ([#1806](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/1806)) ([0005ab9](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/commit/0005ab9f9b9d23e4747dae9e369f69bbaab40b27))
24+
* firewall rules for autopilot clusters are ineffective. add cluster_network_tag to autopilot cluster network_tags if firewalls are toggled on ([#1817](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/1817)) ([e7b20cd](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/commit/e7b20cd193188bdfebd8e2f6a4eb863b0f5af21c))
25+
* Fix the value of output "identity_service_enabled" in beta modules ([#1982](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/1982)) ([a6210fc](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/commit/a6210fc3d607772c2ef83ece2725fc58981ea7fe))
26+
927
## [31.0.0](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/compare/v30.3.0...v31.0.0) (2024-05-28)
1028

1129

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,8 @@ 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 gke-security-groups@yourdomain.com | `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> 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> 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> })</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> "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 |
146+
| 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 |
147+
| 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> 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 |
147148
| cluster\_dns\_domain | The suffix used for all cluster service records. | `string` | `""` | no |
148149
| cluster\_dns\_provider | Which in-cluster DNS provider should be used. PROVIDER\_UNSPECIFIED (default) or PLATFORM\_DEFAULT or CLOUD\_DNS. | `string` | `"PROVIDER_UNSPECIFIED"` | no |
149150
| 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 |
@@ -161,6 +162,7 @@ Then perform the following commands on the root folder:
161162
| disable\_legacy\_metadata\_endpoints | Disable the /0.1/ and /v1beta1/ metadata server endpoints on the node. Changing this value will cause all node pools to be recreated. | `bool` | `true` | no |
162163
| dns\_cache | The status of the NodeLocal DNSCache addon. | `bool` | `false` | no |
163164
| enable\_binary\_authorization | Enable BinAuthZ Admission controller | `bool` | `false` | no |
165+
| enable\_cilium\_clusterwide\_network\_policy | Enable Cilium Cluster Wide Network Policies on the cluster | `bool` | `false` | no |
164166
| enable\_confidential\_nodes | An optional flag to enable confidential node config. | `bool` | `false` | no |
165167
| enable\_cost\_allocation | Enables Cost Allocation Feature and the cluster name and namespace of your GKE workloads appear in the labels field of the billing export to BigQuery | `bool` | `false` | no |
166168
| 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 |

autogen/main/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ The node_pools variable takes the following parameters:
201201
| cpu_manager_policy | The CPU manager policy on the node. One of "none" or "static". | "static" | Optional |
202202
| cpu_cfs_quota | Enforces the Pod's CPU limit. Setting this value to false means that the CPU limits for Pods are ignored | null | Optional |
203203
| cpu_cfs_quota_period | The CPU CFS quota period value, which specifies the period of how often a cgroup's access to CPU resources should be reallocated | null | Optional |
204+
| pod_pids_limit | Controls the maximum number of processes allowed to run in a pod. The value must be greater than or equal to 1024 and less than 4194304. | null | Optional |
204205
| enable\_confidential\_nodes | An optional flag to enable confidential node config. | `bool` | `false` | no |
205206
{% endif %}
206207
| disk_size_gb | Size of the disk attached to each node, specified in GB. The smallest allowed disk size is 10GB | 100 | Optional |

autogen/main/cluster.tf.tmpl

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ resource "google_container_cluster" "primary" {
139139
service_account = local.service_account
140140
oauth_scopes = local.node_pools_oauth_scopes["all"]
141141

142+
boot_disk_kms_key = var.boot_disk_kms_key
143+
142144
management {
143145
auto_repair = lookup(var.cluster_autoscaling, "auto_repair", true)
144146
auto_upgrade = lookup(var.cluster_autoscaling, "auto_upgrade",true)
@@ -166,6 +168,11 @@ resource "google_container_cluster" "primary" {
166168
}
167169
}
168170

171+
shielded_instance_config {
172+
enable_secure_boot = lookup(var.cluster_autoscaling, "enable_secure_boot", false)
173+
enable_integrity_monitoring = lookup(var.cluster_autoscaling, "enable_integrity_monitoring", true)
174+
}
175+
169176
{% if beta_cluster %}
170177
min_cpu_platform = lookup(var.node_pools[0], "min_cpu_platform", "")
171178
{% endif %}
@@ -214,6 +221,13 @@ resource "google_container_cluster" "primary" {
214221
{% if beta_cluster %}
215222
enable_intranode_visibility = var.enable_intranode_visibility
216223

224+
dynamic "secret_manager_config" {
225+
for_each = var.enable_secret_manager_addon ? [var.enable_secret_manager_addon] : []
226+
content {
227+
enabled = secret_manager_config.value
228+
}
229+
}
230+
217231
dynamic "pod_security_policy_config" {
218232
for_each = var.enable_pod_security_policy ? [var.enable_pod_security_policy] : []
219233
content {
@@ -228,9 +242,12 @@ resource "google_container_cluster" "primary" {
228242
}
229243
}
230244
{% endif %}
245+
{% endif %}
231246

232247
enable_l4_ilb_subsetting = var.enable_l4_ilb_subsetting
233-
{% endif %}
248+
249+
enable_cilium_clusterwide_network_policy = var.enable_cilium_clusterwide_network_policy
250+
234251
{% if beta_cluster %}
235252
enable_fqdn_network_policy = var.enable_fqdn_network_policy
236253
{% endif %}
@@ -251,10 +268,10 @@ resource "google_container_cluster" "primary" {
251268
}
252269
{% if autopilot_cluster %}
253270
dynamic "node_pool_auto_config" {
254-
for_each = length(var.network_tags) > 0 ? [1] : []
271+
for_each = length(var.network_tags) > 0 || var.add_cluster_firewall_rules || var.add_master_webhook_firewall_rules || var.add_shadow_firewall_rules ? [1] : []
255272
content {
256273
network_tags {
257-
tags = var.network_tags
274+
tags = var.add_cluster_firewall_rules || var.add_master_webhook_firewall_rules || var.add_shadow_firewall_rules ? concat(var.network_tags, [local.cluster_network_tag]) : var.network_tags
258275
}
259276
}
260277
}
@@ -314,6 +331,11 @@ resource "google_container_cluster" "primary" {
314331
}
315332
}
316333

334+
config_connector_config {
335+
enabled = var.config_connector
336+
}
337+
{% endif %}
338+
317339
dynamic "gke_backup_agent_config" {
318340
for_each = local.gke_backup_agent_config
319341

@@ -337,13 +359,7 @@ resource "google_container_cluster" "primary" {
337359
enabled = stateful_ha_config.value.enabled
338360
}
339361
}
340-
341-
config_connector_config {
342-
enabled = var.config_connector
343-
}
344-
{% endif %}
345362
{% if beta_cluster and autopilot_cluster != true %}
346-
347363
istio_config {
348364
disabled = !var.istio
349365
auth = var.istio_auth
@@ -519,7 +535,7 @@ resource "google_container_cluster" "primary" {
519535
}
520536
}
521537

522-
boot_disk_kms_key = lookup(var.node_pools[0], "boot_disk_kms_key", "")
538+
boot_disk_kms_key = lookup(var.node_pools[0], "boot_disk_kms_key", var.boot_disk_kms_key)
523539
{% endif %}
524540

525541
shielded_instance_config {
@@ -988,13 +1004,14 @@ resource "google_container_node_pool" "windows_pools" {
9881004
dynamic "kubelet_config" {
9891005
for_each = length(setintersection(
9901006
keys(each.value),
991-
["cpu_manager_policy", "cpu_cfs_quota", "cpu_cfs_quota_period"]
1007+
["cpu_manager_policy", "cpu_cfs_quota", "cpu_cfs_quota_period", "pod_pids_limit"]
9921008
)) != 0 ? [1] : []
9931009

9941010
content {
9951011
cpu_manager_policy = lookup(each.value, "cpu_manager_policy", "static")
9961012
cpu_cfs_quota = lookup(each.value, "cpu_cfs_quota", null)
9971013
cpu_cfs_quota_period = lookup(each.value, "cpu_cfs_quota_period", null)
1014+
pod_pids_limit = lookup(each.value, "pod_pids_limit", null)
9981015
}
9991016
}
10001017
{% endif %}

autogen/main/main.tf.tmpl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,10 @@ locals {
107107
}]
108108
cluster_gce_pd_csi_config = var.gce_pd_csi_driver ? [{ enabled = true }] : [{ enabled = false }]
109109
logmon_config_is_set = length(var.logging_enabled_components) > 0 || length(var.monitoring_enabled_components) > 0 || var.monitoring_enable_managed_prometheus
110+
{% endif %}
110111
gke_backup_agent_config = var.gke_backup_agent_config ? [{ enabled = true }] : [{ enabled = false }]
111112
gcs_fuse_csi_driver_config = var.gcs_fuse_csi_driver ? [{ enabled = true }] : []
112113
stateful_ha_config = var.stateful_ha ? [{ enabled = true }] : []
113-
{% endif %}
114114
{% if beta_cluster and autopilot_cluster != true %}
115115
cluster_cloudrun_config_load_balancer_config = (var.cloudrun && var.cloudrun_load_balancer_type != "") ? {
116116
load_balancer_type = var.cloudrun_load_balancer_type
@@ -168,6 +168,8 @@ locals {
168168
cluster_output_istio_disabled = google_container_cluster.primary.addons_config[0].istio_config != null && length(google_container_cluster.primary.addons_config[0].istio_config) == 1 ? google_container_cluster.primary.addons_config[0].istio_config[0].disabled : false
169169
cluster_output_pod_security_policy_enabled = google_container_cluster.primary.pod_security_policy_config != null && length(google_container_cluster.primary.pod_security_policy_config) == 1 ? google_container_cluster.primary.pod_security_policy_config[0].enabled : false
170170
cluster_output_intranode_visbility_enabled = google_container_cluster.primary.enable_intranode_visibility
171+
cluster_output_identity_service_enabled = google_container_cluster.primary.identity_service_config != null && length(google_container_cluster.primary.identity_service_config) == 1 ? google_container_cluster.primary.identity_service_config[0].enabled : false
172+
cluster_output_secret_manager_addon_enabled = google_container_cluster.primary.secret_manager_config != null && length(google_container_cluster.primary.secret_manager_config) == 1 ? google_container_cluster.primary.secret_manager_config[0].enabled : false
171173

172174
# /BETA features
173175
{% endif %}
@@ -237,6 +239,8 @@ locals {
237239
{% endif %}
238240
cluster_pod_security_policy_enabled = local.cluster_output_pod_security_policy_enabled
239241
cluster_intranode_visibility_enabled = local.cluster_output_intranode_visbility_enabled
242+
cluster_identity_service_enabled = local.cluster_output_identity_service_enabled
243+
cluster_secret_manager_addon_enabled = local.cluster_output_secret_manager_addon_enabled
240244

241245
# /BETA features
242246
{% endif %}

autogen/main/outputs.tf.tmpl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,12 @@ output "intranode_visibility_enabled" {
231231

232232
output "identity_service_enabled" {
233233
description = "Whether Identity Service is enabled"
234-
value = local.cluster_pod_security_policy_enabled
234+
value = local.cluster_identity_service_enabled
235+
}
236+
237+
output "secret_manager_addon_enabled" {
238+
description = "Whether Secret Manager add-on is enabled"
239+
value = local.cluster_secret_manager_addon_enabled
235240
}
236241
{% endif %}
237242

0 commit comments

Comments
 (0)