Skip to content

Commit d96afa7

Browse files
authored
feat: Add GCE PD CSI Driver beta support (#497)
BREAKING CHANGE: Minimum provider change increased to 3.19.
1 parent c090d5b commit d96afa7

File tree

30 files changed

+100
-13
lines changed

30 files changed

+100
-13
lines changed

autogen/main/cluster.tf.tmpl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,14 @@ resource "google_container_cluster" "primary" {
152152
dns_cache_config {
153153
enabled = var.dns_cache
154154
}
155+
156+
dynamic "gce_persistent_disk_csi_driver_config" {
157+
for_each = local.cluster_gce_pd_csi_config
158+
159+
content {
160+
enabled = gce_persistent_disk_csi_driver_config.value.enabled
161+
}
162+
}
155163
{% endif %}
156164
}
157165

autogen/main/main.tf.tmpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ locals {
8888
{% if beta_cluster %}
8989
cluster_cloudrun_config = var.cloudrun ? [{ disabled = false }] : []
9090

91+
cluster_gce_pd_csi_config = var.gce_pd_csi_driver ? [{ enabled = true }] : [{ enabled = false }]
92+
9193
cluster_node_metadata_config = var.node_metadata == "UNSPECIFIED" ? [] : [{
9294
node_metadata = var.node_metadata
9395
}]

autogen/main/variables.tf.tmpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,12 @@ variable "dns_cache" {
417417
default = false
418418
}
419419

420+
variable "gce_pd_csi_driver" {
421+
type = bool
422+
description = "(Beta) Whether this cluster should enable the Google Compute Engine Persistent Disk Container Storage Interface (CSI) Driver."
423+
default = false
424+
}
425+
420426
variable "database_encryption" {
421427
description = "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."
422428
type = list(object({ state = string, key_name = string }))

autogen/main/versions.tf.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ terraform {
1919

2020
required_providers {
2121
{% if beta_cluster %}
22-
google-beta = ">= 3.16, <4.0.0"
22+
google-beta = ">= 3.19, <4.0.0"
2323
{% else %}
2424
google = ">= 3.16, <4.0.0"
2525
{% endif %}

examples/node_pool/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ locals {
1919
}
2020

2121
provider "google-beta" {
22-
version = "~> 3.16.0"
22+
version = "~> 3.19.0"
2323
region = var.region
2424
}
2525

examples/node_pool_update_variant_beta/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ locals {
1919
}
2020

2121
provider "google-beta" {
22-
version = "~> 3.16.0"
22+
version = "~> 3.19.0"
2323
credentials = file(var.credentials_path)
2424
region = var.region
2525
}

examples/safer_cluster/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ provider "google" {
3434
}
3535

3636
provider "google-beta" {
37-
version = "~> 3.16.0"
37+
version = "~> 3.19.0"
3838
}
3939

4040
module "gke" {

examples/simple_regional_beta/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ This example illustrates how to create a simple cluster with beta features.
1313
| 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. | object | `<list>` | no |
1414
| dns\_cache | (Beta) The status of the NodeLocal DNSCache addon. | bool | `"false"` | no |
1515
| enable\_binary\_authorization | Enable BinAuthZ Admission controller | string | `"false"` | no |
16+
| gce\_pd\_csi\_driver | (Beta) Whether this cluster should enable the Google Compute Engine Persistent Disk Container Storage Interface (CSI) Driver. | bool | `"false"` | no |
1617
| ip\_range\_pods | The secondary ip range to use for pods | string | n/a | yes |
1718
| ip\_range\_services | The secondary ip range to use for services | string | n/a | yes |
1819
| istio | Boolean to enable / disable Istio | string | `"true"` | no |

examples/simple_regional_beta/main.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ locals {
1919
}
2020

2121
provider "google-beta" {
22-
version = "~> 3.16.0"
22+
version = "~> 3.19.0"
2323
region = var.region
2424
}
2525

@@ -39,6 +39,7 @@ module "gke" {
3939
istio = var.istio
4040
cloudrun = var.cloudrun
4141
dns_cache = var.dns_cache
42+
gce_pd_csi_driver = var.gce_pd_csi_driver
4243
node_metadata = var.node_metadata
4344
sandbox_enabled = var.sandbox_enabled
4445
remove_default_node_pool = var.remove_default_node_pool

examples/simple_regional_beta/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ variable "dns_cache" {
6363
default = false
6464
}
6565

66+
variable "gce_pd_csi_driver" {
67+
type = bool
68+
description = "(Beta) Whether this cluster should enable the Google Compute Engine Persistent Disk Container Storage Interface (CSI) Driver."
69+
default = false
70+
}
71+
6672
variable "node_metadata" {
6773
description = "Specifies how node metadata is exposed to the workload running on the node"
6874
default = "SECURE"

0 commit comments

Comments
 (0)