From 6b0b147e7ecc068ef9408849c13cb8c01594fe7a Mon Sep 17 00:00:00 2001 From: "T.V.VIGNESH" Date: Mon, 1 Jun 2020 11:27:14 +0530 Subject: [PATCH] Added PD CSI Driver Addon support (#84) * Added PD CSI Driver Addon support Google supports CSI Driver for PD (https://cloud.google.com/kubernetes-engine/docs/how-to/gce-pd-csi-driver) which is also supported by TF Google Beta Provider (https://www.terraform.io/docs/providers/google/r/container_cluster.html#gce_persistent_disk_csi_driver_config). Added the same support to this module. * Added PD CSI Config to variables The PD CSI config has been added to variables to support PD CSI Driver (https://www.terraform.io/docs/providers/google/r/container_cluster.html#gce_persistent_disk_csi_driver_config) --- modules/gke-cluster/main.tf | 3 +++ modules/gke-cluster/variables.tf | 2 ++ 2 files changed, 5 insertions(+) diff --git a/modules/gke-cluster/main.tf b/modules/gke-cluster/main.tf index d08ea0d8..86fe095a 100644 --- a/modules/gke-cluster/main.tf +++ b/modules/gke-cluster/main.tf @@ -75,6 +75,9 @@ resource "google_container_cluster" "cluster" { disabled = ! var.addons.istio_config.enabled auth = var.addons.istio_config.tls ? "AUTH_MUTUAL_TLS" : "AUTH_NONE" } + gce_persistent_disk_csi_driver_config { + enabled = var.addons.gce_persistent_disk_csi_driver_config + } } # TODO(ludomagno): support setting address ranges instead of range names diff --git a/modules/gke-cluster/variables.tf b/modules/gke-cluster/variables.tf index 270a20f2..62b3709c 100644 --- a/modules/gke-cluster/variables.tf +++ b/modules/gke-cluster/variables.tf @@ -26,6 +26,7 @@ variable "addons" { tls = bool }) network_policy_config = bool + gce_persistent_disk_csi_driver_config = bool }) default = { cloudrun_config = false @@ -37,6 +38,7 @@ variable "addons" { tls = false } network_policy_config = false + gce_persistent_disk_csi_driver_config = false } }