Skip to content

Commit ac062f8

Browse files
authored
feat!: promote gce_pd_csi_driver to GA (#1509)
1 parent d122a55 commit ac062f8

File tree

34 files changed

+181
-101
lines changed

34 files changed

+181
-101
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ Then perform the following commands on the root folder:
155155
| filestore\_csi\_driver | The status of the Filestore CSI driver addon, which allows the usage of filestore instance as volumes | `bool` | `false` | no |
156156
| firewall\_inbound\_ports | List of TCP ports for admission/webhook controllers. Either flag `add_master_webhook_firewall_rules` or `add_cluster_firewall_rules` (also adds egress rules) must be set to `true` for inbound-ports firewall rules to be applied. | `list(string)` | <pre>[<br> "8443",<br> "9443",<br> "15017"<br>]</pre> | no |
157157
| firewall\_priority | Priority rule for firewall rules | `number` | `1000` | no |
158+
| gce\_pd\_csi\_driver | Whether this cluster should enable the Google Compute Engine Persistent Disk Container Storage Interface (CSI) Driver. | `bool` | `true` | no |
158159
| grant\_registry\_access | Grants created cluster-specific service account storage.objectViewer and artifactregistry.reader roles. | `bool` | `false` | no |
159160
| horizontal\_pod\_autoscaling | Enable horizontal pod autoscaling addon | `bool` | `true` | no |
160161
| http\_load\_balancing | Enable httpload balancer addon | `bool` | `true` | no |

autogen/main/cluster.tf.tmpl

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,6 @@ resource "google_container_cluster" "primary" {
235235
disabled = !var.horizontal_pod_autoscaling
236236
}
237237

238-
239238
{% if autopilot_cluster != true %}
240239
network_policy_config {
241240
disabled = !var.network_policy
@@ -248,6 +247,14 @@ resource "google_container_cluster" "primary" {
248247
gcp_filestore_csi_driver_config {
249248
enabled = var.filestore_csi_driver
250249
}
250+
251+
dynamic "gce_persistent_disk_csi_driver_config" {
252+
for_each = local.cluster_gce_pd_csi_config
253+
254+
content {
255+
enabled = gce_persistent_disk_csi_driver_config.value.enabled
256+
}
257+
}
251258
{% endif %}
252259
{% if beta_cluster and autopilot_cluster != true %}
253260

@@ -264,14 +271,6 @@ resource "google_container_cluster" "primary" {
264271
}
265272
}
266273

267-
dynamic "gce_persistent_disk_csi_driver_config" {
268-
for_each = local.cluster_gce_pd_csi_config
269-
270-
content {
271-
enabled = gce_persistent_disk_csi_driver_config.value.enabled
272-
}
273-
}
274-
275274
kalm_config {
276275
enabled = var.kalm_config
277276
}

autogen/main/main.tf.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ locals {
9595
enabled = false
9696
provider = null
9797
}]
98+
cluster_gce_pd_csi_config = var.gce_pd_csi_driver ? [{ enabled = true }] : [{ enabled = false }]
9899
{% endif %}
99100
{% if beta_cluster and autopilot_cluster != true %}
100101
cluster_cloudrun_config_load_balancer_config = (var.cloudrun && var.cloudrun_load_balancer_type != "") ? {
@@ -109,7 +110,6 @@ locals {
109110
)
110111
] : []
111112
cluster_cloudrun_enabled = var.cloudrun
112-
cluster_gce_pd_csi_config = var.gce_pd_csi_driver ? [{ enabled = true }] : [{ enabled = false }]
113113
gke_backup_agent_config = var.gke_backup_agent_config ? [{ enabled = true }] : [{ enabled = false }]
114114
logmon_config_is_set = length(var.logging_enabled_components) > 0 || length(var.monitoring_enabled_components) > 0 || var.monitoring_enable_managed_prometheus
115115
{% endif %}

autogen/main/variables.tf.tmpl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,12 @@ variable "cluster_dns_domain" {
605605
default = ""
606606
}
607607

608+
variable "gce_pd_csi_driver" {
609+
type = bool
610+
description = "Whether this cluster should enable the Google Compute Engine Persistent Disk Container Storage Interface (CSI) Driver."
611+
default = true
612+
}
613+
608614
{% endif %}
609615
variable "timeouts" {
610616
type = map(string)
@@ -713,11 +719,5 @@ variable "enable_identity_service" {
713719
description = "Enable the Identity Service component, which allows customers to use external identity providers with the K8S API."
714720
default = false
715721
}
716-
717-
variable "gce_pd_csi_driver" {
718-
type = bool
719-
description = "(Beta) Whether this cluster should enable the Google Compute Engine Persistent Disk Container Storage Interface (CSI) Driver."
720-
default = false
721-
}
722722
{% endif %}
723723
{% endif %}

cluster.tf

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ resource "google_container_cluster" "primary" {
131131
disabled = !var.horizontal_pod_autoscaling
132132
}
133133

134-
135134
network_policy_config {
136135
disabled = !var.network_policy
137136
}
@@ -143,6 +142,14 @@ resource "google_container_cluster" "primary" {
143142
gcp_filestore_csi_driver_config {
144143
enabled = var.filestore_csi_driver
145144
}
145+
146+
dynamic "gce_persistent_disk_csi_driver_config" {
147+
for_each = local.cluster_gce_pd_csi_config
148+
149+
content {
150+
enabled = gce_persistent_disk_csi_driver_config.value.enabled
151+
}
152+
}
146153
}
147154

148155
datapath_provider = var.datapath_provider

docs/upgrading_to_v25.0.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Upgrading to v25.0
2+
The v25.0 release of *kubernetes-engine* is a backwards incompatible
3+
release.
4+
5+
### gce_pd_csi_driver is GA and enabled by default
6+
7+
`gce_pd_csi_driver` is now supported in GA modules and defaults to true. To opt out, set `gce_pd_csi_driver` to `false`.
8+
9+
```diff
10+
module "gke" {
11+
- source = "terraform-google-modules/kubernetes-engine"
12+
- version = "~> 24.0"
13+
+ source = "terraform-google-modules/kubernetes-engine"
14+
+ version = "~> 25.0"
15+
...
16+
+ gce_pd_csi_driver = false
17+
}
18+
```
19+
20+
### Use the created service account when creating autopilot clusters
21+
22+
When `create_service_account` is `true` pass the created service account to the `cluster_autoscaling` -> `auto_provisioning_defaults` block
23+
for the `beta-autopilot-private-cluster` / `beta-autopilot-public-cluster` modules.
24+
25+
This will mean that the `Nodes` will use the created service account, where previously the default service account was erronously used instead.
26+
27+
To opt out, set `create_service_account` to `false`
28+
29+
```diff
30+
module "gke" {
31+
- source = "terraform-google-modules/kubernetes-engine"
32+
- version = "~> 24.0"
33+
+ source = "terraform-google-modules/kubernetes-engine"
34+
+ version = "~> 25.0"
35+
...
36+
+ create_service_account = false
37+
}
38+
```
39+
40+
### Minimum Google Provider versions
41+
42+
Minimum Google Provider versions have been updated to `4.44.0`.

main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ locals {
8181
enabled = false
8282
provider = null
8383
}]
84+
cluster_gce_pd_csi_config = var.gce_pd_csi_driver ? [{ enabled = true }] : [{ enabled = false }]
8485

8586
cluster_authenticator_security_group = var.authenticator_security_group == null ? [] : [{
8687
security_group = var.authenticator_security_group

modules/beta-autopilot-private-cluster/cluster.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ resource "google_container_cluster" "primary" {
119119
disabled = !var.horizontal_pod_autoscaling
120120
}
121121

122-
123122
}
124123

125124
datapath_provider = var.datapath_provider

modules/beta-autopilot-public-cluster/cluster.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ resource "google_container_cluster" "primary" {
119119
disabled = !var.horizontal_pod_autoscaling
120120
}
121121

122-
123122
}
124123

125124
datapath_provider = var.datapath_provider

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ Then perform the following commands on the root folder:
201201
| filestore\_csi\_driver | The status of the Filestore CSI driver addon, which allows the usage of filestore instance as volumes | `bool` | `false` | no |
202202
| firewall\_inbound\_ports | List of TCP ports for admission/webhook controllers. Either flag `add_master_webhook_firewall_rules` or `add_cluster_firewall_rules` (also adds egress rules) must be set to `true` for inbound-ports firewall rules to be applied. | `list(string)` | <pre>[<br> "8443",<br> "9443",<br> "15017"<br>]</pre> | no |
203203
| firewall\_priority | Priority rule for firewall rules | `number` | `1000` | no |
204-
| gce\_pd\_csi\_driver | (Beta) Whether this cluster should enable the Google Compute Engine Persistent Disk Container Storage Interface (CSI) Driver. | `bool` | `false` | no |
204+
| gce\_pd\_csi\_driver | Whether this cluster should enable the Google Compute Engine Persistent Disk Container Storage Interface (CSI) Driver. | `bool` | `true` | no |
205205
| gke\_backup\_agent\_config | (Beta) Whether Backup for GKE agent is enabled for this cluster. | `bool` | `false` | no |
206206
| grant\_registry\_access | Grants created cluster-specific service account storage.objectViewer and artifactregistry.reader roles. | `bool` | `false` | no |
207207
| horizontal\_pod\_autoscaling | Enable horizontal pod autoscaling addon | `bool` | `true` | no |

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

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ resource "google_container_cluster" "primary" {
187187
disabled = !var.horizontal_pod_autoscaling
188188
}
189189

190-
191190
network_policy_config {
192191
disabled = !var.network_policy
193192
}
@@ -200,6 +199,14 @@ resource "google_container_cluster" "primary" {
200199
enabled = var.filestore_csi_driver
201200
}
202201

202+
dynamic "gce_persistent_disk_csi_driver_config" {
203+
for_each = local.cluster_gce_pd_csi_config
204+
205+
content {
206+
enabled = gce_persistent_disk_csi_driver_config.value.enabled
207+
}
208+
}
209+
203210
istio_config {
204211
disabled = !var.istio
205212
auth = var.istio_auth
@@ -213,14 +220,6 @@ resource "google_container_cluster" "primary" {
213220
}
214221
}
215222

216-
dynamic "gce_persistent_disk_csi_driver_config" {
217-
for_each = local.cluster_gce_pd_csi_config
218-
219-
content {
220-
enabled = gce_persistent_disk_csi_driver_config.value.enabled
221-
}
222-
}
223-
224223
kalm_config {
225224
enabled = var.kalm_config
226225
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ locals {
8282
enabled = false
8383
provider = null
8484
}]
85+
cluster_gce_pd_csi_config = var.gce_pd_csi_driver ? [{ enabled = true }] : [{ enabled = false }]
8586
cluster_cloudrun_config_load_balancer_config = (var.cloudrun && var.cloudrun_load_balancer_type != "") ? {
8687
load_balancer_type = var.cloudrun_load_balancer_type
8788
} : {}
@@ -93,10 +94,9 @@ locals {
9394
local.cluster_cloudrun_config_load_balancer_config
9495
)
9596
] : []
96-
cluster_cloudrun_enabled = var.cloudrun
97-
cluster_gce_pd_csi_config = var.gce_pd_csi_driver ? [{ enabled = true }] : [{ enabled = false }]
98-
gke_backup_agent_config = var.gke_backup_agent_config ? [{ enabled = true }] : [{ enabled = false }]
99-
logmon_config_is_set = length(var.logging_enabled_components) > 0 || length(var.monitoring_enabled_components) > 0 || var.monitoring_enable_managed_prometheus
97+
cluster_cloudrun_enabled = var.cloudrun
98+
gke_backup_agent_config = var.gke_backup_agent_config ? [{ enabled = true }] : [{ enabled = false }]
99+
logmon_config_is_set = length(var.logging_enabled_components) > 0 || length(var.monitoring_enabled_components) > 0 || var.monitoring_enable_managed_prometheus
100100

101101
cluster_authenticator_security_group = var.authenticator_security_group == null ? [] : [{
102102
security_group = var.authenticator_security_group

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,12 @@ variable "cluster_dns_domain" {
578578
default = ""
579579
}
580580

581+
variable "gce_pd_csi_driver" {
582+
type = bool
583+
description = "Whether this cluster should enable the Google Compute Engine Persistent Disk Container Storage Interface (CSI) Driver."
584+
default = true
585+
}
586+
581587
variable "timeouts" {
582588
type = map(string)
583589
description = "Timeout for cluster operations."
@@ -681,9 +687,3 @@ variable "enable_identity_service" {
681687
description = "Enable the Identity Service component, which allows customers to use external identity providers with the K8S API."
682688
default = false
683689
}
684-
685-
variable "gce_pd_csi_driver" {
686-
type = bool
687-
description = "(Beta) Whether this cluster should enable the Google Compute Engine Persistent Disk Container Storage Interface (CSI) Driver."
688-
default = false
689-
}

modules/beta-private-cluster/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ Then perform the following commands on the root folder:
179179
| filestore\_csi\_driver | The status of the Filestore CSI driver addon, which allows the usage of filestore instance as volumes | `bool` | `false` | no |
180180
| firewall\_inbound\_ports | List of TCP ports for admission/webhook controllers. Either flag `add_master_webhook_firewall_rules` or `add_cluster_firewall_rules` (also adds egress rules) must be set to `true` for inbound-ports firewall rules to be applied. | `list(string)` | <pre>[<br> "8443",<br> "9443",<br> "15017"<br>]</pre> | no |
181181
| firewall\_priority | Priority rule for firewall rules | `number` | `1000` | no |
182-
| gce\_pd\_csi\_driver | (Beta) Whether this cluster should enable the Google Compute Engine Persistent Disk Container Storage Interface (CSI) Driver. | `bool` | `false` | no |
182+
| gce\_pd\_csi\_driver | Whether this cluster should enable the Google Compute Engine Persistent Disk Container Storage Interface (CSI) Driver. | `bool` | `true` | no |
183183
| gke\_backup\_agent\_config | (Beta) Whether Backup for GKE agent is enabled for this cluster. | `bool` | `false` | no |
184184
| grant\_registry\_access | Grants created cluster-specific service account storage.objectViewer and artifactregistry.reader roles. | `bool` | `false` | no |
185185
| horizontal\_pod\_autoscaling | Enable horizontal pod autoscaling addon | `bool` | `true` | no |

modules/beta-private-cluster/cluster.tf

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ resource "google_container_cluster" "primary" {
187187
disabled = !var.horizontal_pod_autoscaling
188188
}
189189

190-
191190
network_policy_config {
192191
disabled = !var.network_policy
193192
}
@@ -200,6 +199,14 @@ resource "google_container_cluster" "primary" {
200199
enabled = var.filestore_csi_driver
201200
}
202201

202+
dynamic "gce_persistent_disk_csi_driver_config" {
203+
for_each = local.cluster_gce_pd_csi_config
204+
205+
content {
206+
enabled = gce_persistent_disk_csi_driver_config.value.enabled
207+
}
208+
}
209+
203210
istio_config {
204211
disabled = !var.istio
205212
auth = var.istio_auth
@@ -213,14 +220,6 @@ resource "google_container_cluster" "primary" {
213220
}
214221
}
215222

216-
dynamic "gce_persistent_disk_csi_driver_config" {
217-
for_each = local.cluster_gce_pd_csi_config
218-
219-
content {
220-
enabled = gce_persistent_disk_csi_driver_config.value.enabled
221-
}
222-
}
223-
224223
kalm_config {
225224
enabled = var.kalm_config
226225
}

modules/beta-private-cluster/main.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ locals {
8282
enabled = false
8383
provider = null
8484
}]
85+
cluster_gce_pd_csi_config = var.gce_pd_csi_driver ? [{ enabled = true }] : [{ enabled = false }]
8586
cluster_cloudrun_config_load_balancer_config = (var.cloudrun && var.cloudrun_load_balancer_type != "") ? {
8687
load_balancer_type = var.cloudrun_load_balancer_type
8788
} : {}
@@ -93,10 +94,9 @@ locals {
9394
local.cluster_cloudrun_config_load_balancer_config
9495
)
9596
] : []
96-
cluster_cloudrun_enabled = var.cloudrun
97-
cluster_gce_pd_csi_config = var.gce_pd_csi_driver ? [{ enabled = true }] : [{ enabled = false }]
98-
gke_backup_agent_config = var.gke_backup_agent_config ? [{ enabled = true }] : [{ enabled = false }]
99-
logmon_config_is_set = length(var.logging_enabled_components) > 0 || length(var.monitoring_enabled_components) > 0 || var.monitoring_enable_managed_prometheus
97+
cluster_cloudrun_enabled = var.cloudrun
98+
gke_backup_agent_config = var.gke_backup_agent_config ? [{ enabled = true }] : [{ enabled = false }]
99+
logmon_config_is_set = length(var.logging_enabled_components) > 0 || length(var.monitoring_enabled_components) > 0 || var.monitoring_enable_managed_prometheus
100100

101101
cluster_authenticator_security_group = var.authenticator_security_group == null ? [] : [{
102102
security_group = var.authenticator_security_group

modules/beta-private-cluster/variables.tf

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,12 @@ variable "cluster_dns_domain" {
578578
default = ""
579579
}
580580

581+
variable "gce_pd_csi_driver" {
582+
type = bool
583+
description = "Whether this cluster should enable the Google Compute Engine Persistent Disk Container Storage Interface (CSI) Driver."
584+
default = true
585+
}
586+
581587
variable "timeouts" {
582588
type = map(string)
583589
description = "Timeout for cluster operations."
@@ -681,9 +687,3 @@ variable "enable_identity_service" {
681687
description = "Enable the Identity Service component, which allows customers to use external identity providers with the K8S API."
682688
default = false
683689
}
684-
685-
variable "gce_pd_csi_driver" {
686-
type = bool
687-
description = "(Beta) Whether this cluster should enable the Google Compute Engine Persistent Disk Container Storage Interface (CSI) Driver."
688-
default = false
689-
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ Then perform the following commands on the root folder:
192192
| filestore\_csi\_driver | The status of the Filestore CSI driver addon, which allows the usage of filestore instance as volumes | `bool` | `false` | no |
193193
| firewall\_inbound\_ports | List of TCP ports for admission/webhook controllers. Either flag `add_master_webhook_firewall_rules` or `add_cluster_firewall_rules` (also adds egress rules) must be set to `true` for inbound-ports firewall rules to be applied. | `list(string)` | <pre>[<br> "8443",<br> "9443",<br> "15017"<br>]</pre> | no |
194194
| firewall\_priority | Priority rule for firewall rules | `number` | `1000` | no |
195-
| gce\_pd\_csi\_driver | (Beta) Whether this cluster should enable the Google Compute Engine Persistent Disk Container Storage Interface (CSI) Driver. | `bool` | `false` | no |
195+
| gce\_pd\_csi\_driver | Whether this cluster should enable the Google Compute Engine Persistent Disk Container Storage Interface (CSI) Driver. | `bool` | `true` | no |
196196
| gke\_backup\_agent\_config | (Beta) Whether Backup for GKE agent is enabled for this cluster. | `bool` | `false` | no |
197197
| grant\_registry\_access | Grants created cluster-specific service account storage.objectViewer and artifactregistry.reader roles. | `bool` | `false` | no |
198198
| horizontal\_pod\_autoscaling | Enable horizontal pod autoscaling addon | `bool` | `true` | no |

0 commit comments

Comments
 (0)