Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support gcp_filestore_csi_driver_config for autopilot #2126

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions autogen/main/cluster.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,10 @@ resource "google_container_cluster" "primary" {
disabled = !var.horizontal_pod_autoscaling
}

gcp_filestore_csi_driver_config {
enabled = var.filestore_csi_driver
}

{% if autopilot_cluster != true %}
network_policy_config {
disabled = !var.network_policy
Expand All @@ -322,10 +326,6 @@ resource "google_container_cluster" "primary" {
enabled = var.dns_cache
}

gcp_filestore_csi_driver_config {
enabled = var.filestore_csi_driver
}

dynamic "gce_persistent_disk_csi_driver_config" {
for_each = local.cluster_gce_pd_csi_config

Expand Down
12 changes: 6 additions & 6 deletions autogen/main/variables.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,12 @@ variable "enable_tpu" {
default = false
}

variable "filestore_csi_driver" {
type = bool
description = "The status of the Filestore CSI driver addon, which allows the usage of filestore instance as volumes"
default = false
}

{% if autopilot_cluster != true %}
variable "network_policy" {
type = bool
Expand All @@ -713,12 +719,6 @@ variable "remove_default_node_pool" {
default = false
}

variable "filestore_csi_driver" {
type = bool
description = "The status of the Filestore CSI driver addon, which allows the usage of filestore instance as volumes"
default = false
}

variable "disable_legacy_metadata_endpoints" {
type = bool
description = "Disable the /0.1/ and /v1beta1/ metadata server endpoints on the node. Changing this value will cause all node pools to be recreated."
Expand Down
9 changes: 3 additions & 6 deletions autogen/main/versions.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,11 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
# Workaround for https://github.com/hashicorp/terraform-provider-google/issues/19428
version = ">= 5.40.0, != 5.44.0, != 6.2.0, != 6.3.0, < 7"
version = ">= 6.5.0, < 7"
}
google-beta = {
source = "hashicorp/google-beta"
# Workaround for https://github.com/hashicorp/terraform-provider-google/issues/19428
version = ">= 5.40.0, != 5.44.0, != 6.2.0, != 6.3.0, < 7"
version = ">= 6.5.0, < 7"
}
kubernetes = {
source = "hashicorp/kubernetes"
Expand All @@ -70,8 +68,7 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
# Workaround for https://github.com/hashicorp/terraform-provider-google/issues/19428
version = ">= 5.40.0, != 5.44.0, != 6.2.0, != 6.3.0, < 7"
version = ">= 6.5.0, < 7"
}
kubernetes = {
source = "hashicorp/kubernetes"
Expand Down
8 changes: 4 additions & 4 deletions cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,10 @@ resource "google_container_cluster" "primary" {
disabled = !var.horizontal_pod_autoscaling
}

gcp_filestore_csi_driver_config {
enabled = var.filestore_csi_driver
}

network_policy_config {
disabled = !var.network_policy
}
Expand All @@ -242,10 +246,6 @@ resource "google_container_cluster" "primary" {
enabled = var.dns_cache
}

gcp_filestore_csi_driver_config {
enabled = var.filestore_csi_driver
}

dynamic "gce_persistent_disk_csi_driver_config" {
for_each = local.cluster_gce_pd_csi_config

Expand Down
1 change: 1 addition & 0 deletions modules/beta-autopilot-private-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ Then perform the following commands on the root folder:
| enable\_secret\_manager\_addon | (Beta) Enable the Secret Manager add-on for this cluster | `bool` | `false` | no |
| enable\_tpu | Enable Cloud TPU resources in the cluster. WARNING: changing this after cluster creation is destructive! | `bool` | `false` | no |
| enable\_vertical\_pod\_autoscaling | Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it | `bool` | `true` | no |
| filestore\_csi\_driver | The status of the Filestore CSI driver addon, which allows the usage of filestore instance as volumes | `bool` | `false` | no |
| 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 |
| firewall\_priority | Priority rule for firewall rules | `number` | `1000` | no |
| fleet\_project | (Optional) Register the cluster with the fleet in this project. | `string` | `null` | no |
Expand Down
4 changes: 4 additions & 0 deletions modules/beta-autopilot-private-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ resource "google_container_cluster" "primary" {
disabled = !var.horizontal_pod_autoscaling
}

gcp_filestore_csi_driver_config {
enabled = var.filestore_csi_driver
}


dynamic "gke_backup_agent_config" {
for_each = local.gke_backup_agent_config
Expand Down
6 changes: 6 additions & 0 deletions modules/beta-autopilot-private-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,12 @@ variable "enable_tpu" {
default = false
}

variable "filestore_csi_driver" {
type = bool
description = "The status of the Filestore CSI driver addon, which allows the usage of filestore instance as volumes"
default = false
}

variable "database_encryption" {
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."
type = list(object({ state = string, key_name = string }))
Expand Down
10 changes: 4 additions & 6 deletions modules/beta-autopilot-private-cluster/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,12 @@ terraform {

required_providers {
google = {
source = "hashicorp/google"
# Workaround for https://github.com/hashicorp/terraform-provider-google/issues/19428
version = ">= 5.40.0, != 5.44.0, != 6.2.0, != 6.3.0, < 7"
source = "hashicorp/google"
version = ">= 6.5.0, < 7"
}
google-beta = {
source = "hashicorp/google-beta"
# Workaround for https://github.com/hashicorp/terraform-provider-google/issues/19428
version = ">= 5.40.0, != 5.44.0, != 6.2.0, != 6.3.0, < 7"
source = "hashicorp/google-beta"
version = ">= 6.5.0, < 7"
}
kubernetes = {
source = "hashicorp/kubernetes"
Expand Down
1 change: 1 addition & 0 deletions modules/beta-autopilot-public-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ Then perform the following commands on the root folder:
| enable\_secret\_manager\_addon | (Beta) Enable the Secret Manager add-on for this cluster | `bool` | `false` | no |
| enable\_tpu | Enable Cloud TPU resources in the cluster. WARNING: changing this after cluster creation is destructive! | `bool` | `false` | no |
| enable\_vertical\_pod\_autoscaling | Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it | `bool` | `true` | no |
| filestore\_csi\_driver | The status of the Filestore CSI driver addon, which allows the usage of filestore instance as volumes | `bool` | `false` | no |
| 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 |
| firewall\_priority | Priority rule for firewall rules | `number` | `1000` | no |
| fleet\_project | (Optional) Register the cluster with the fleet in this project. | `string` | `null` | no |
Expand Down
4 changes: 4 additions & 0 deletions modules/beta-autopilot-public-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ resource "google_container_cluster" "primary" {
disabled = !var.horizontal_pod_autoscaling
}

gcp_filestore_csi_driver_config {
enabled = var.filestore_csi_driver
}


dynamic "gke_backup_agent_config" {
for_each = local.gke_backup_agent_config
Expand Down
6 changes: 6 additions & 0 deletions modules/beta-autopilot-public-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,12 @@ variable "enable_tpu" {
default = false
}

variable "filestore_csi_driver" {
type = bool
description = "The status of the Filestore CSI driver addon, which allows the usage of filestore instance as volumes"
default = false
}

variable "database_encryption" {
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."
type = list(object({ state = string, key_name = string }))
Expand Down
10 changes: 4 additions & 6 deletions modules/beta-autopilot-public-cluster/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,12 @@ terraform {

required_providers {
google = {
source = "hashicorp/google"
# Workaround for https://github.com/hashicorp/terraform-provider-google/issues/19428
version = ">= 5.40.0, != 5.44.0, != 6.2.0, != 6.3.0, < 7"
source = "hashicorp/google"
version = ">= 6.5.0, < 7"
}
google-beta = {
source = "hashicorp/google-beta"
# Workaround for https://github.com/hashicorp/terraform-provider-google/issues/19428
version = ">= 5.40.0, != 5.44.0, != 6.2.0, != 6.3.0, < 7"
source = "hashicorp/google-beta"
version = ">= 6.5.0, < 7"
}
kubernetes = {
source = "hashicorp/kubernetes"
Expand Down
8 changes: 4 additions & 4 deletions modules/beta-private-cluster-update-variant/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,10 @@ resource "google_container_cluster" "primary" {
disabled = !var.horizontal_pod_autoscaling
}

gcp_filestore_csi_driver_config {
enabled = var.filestore_csi_driver
}

network_policy_config {
disabled = !var.network_policy
}
Expand All @@ -263,10 +267,6 @@ resource "google_container_cluster" "primary" {
enabled = var.dns_cache
}

gcp_filestore_csi_driver_config {
enabled = var.filestore_csi_driver
}

dynamic "gce_persistent_disk_csi_driver_config" {
for_each = local.cluster_gce_pd_csi_config

Expand Down
12 changes: 6 additions & 6 deletions modules/beta-private-cluster-update-variant/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,12 @@ variable "enable_tpu" {
default = false
}

variable "filestore_csi_driver" {
type = bool
description = "The status of the Filestore CSI driver addon, which allows the usage of filestore instance as volumes"
default = false
}

variable "network_policy" {
type = bool
description = "Enable network policy addon"
Expand All @@ -684,12 +690,6 @@ variable "remove_default_node_pool" {
default = false
}

variable "filestore_csi_driver" {
type = bool
description = "The status of the Filestore CSI driver addon, which allows the usage of filestore instance as volumes"
default = false
}

variable "disable_legacy_metadata_endpoints" {
type = bool
description = "Disable the /0.1/ and /v1beta1/ metadata server endpoints on the node. Changing this value will cause all node pools to be recreated."
Expand Down
8 changes: 4 additions & 4 deletions modules/beta-private-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,10 @@ resource "google_container_cluster" "primary" {
disabled = !var.horizontal_pod_autoscaling
}

gcp_filestore_csi_driver_config {
enabled = var.filestore_csi_driver
}

network_policy_config {
disabled = !var.network_policy
}
Expand All @@ -263,10 +267,6 @@ resource "google_container_cluster" "primary" {
enabled = var.dns_cache
}

gcp_filestore_csi_driver_config {
enabled = var.filestore_csi_driver
}

dynamic "gce_persistent_disk_csi_driver_config" {
for_each = local.cluster_gce_pd_csi_config

Expand Down
12 changes: 6 additions & 6 deletions modules/beta-private-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,12 @@ variable "enable_tpu" {
default = false
}

variable "filestore_csi_driver" {
type = bool
description = "The status of the Filestore CSI driver addon, which allows the usage of filestore instance as volumes"
default = false
}

variable "network_policy" {
type = bool
description = "Enable network policy addon"
Expand All @@ -684,12 +690,6 @@ variable "remove_default_node_pool" {
default = false
}

variable "filestore_csi_driver" {
type = bool
description = "The status of the Filestore CSI driver addon, which allows the usage of filestore instance as volumes"
default = false
}

variable "disable_legacy_metadata_endpoints" {
type = bool
description = "Disable the /0.1/ and /v1beta1/ metadata server endpoints on the node. Changing this value will cause all node pools to be recreated."
Expand Down
8 changes: 4 additions & 4 deletions modules/beta-public-cluster-update-variant/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,10 @@ resource "google_container_cluster" "primary" {
disabled = !var.horizontal_pod_autoscaling
}

gcp_filestore_csi_driver_config {
enabled = var.filestore_csi_driver
}

network_policy_config {
disabled = !var.network_policy
}
Expand All @@ -263,10 +267,6 @@ resource "google_container_cluster" "primary" {
enabled = var.dns_cache
}

gcp_filestore_csi_driver_config {
enabled = var.filestore_csi_driver
}

dynamic "gce_persistent_disk_csi_driver_config" {
for_each = local.cluster_gce_pd_csi_config

Expand Down
12 changes: 6 additions & 6 deletions modules/beta-public-cluster-update-variant/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,12 @@ variable "enable_tpu" {
default = false
}

variable "filestore_csi_driver" {
type = bool
description = "The status of the Filestore CSI driver addon, which allows the usage of filestore instance as volumes"
default = false
}

variable "network_policy" {
type = bool
description = "Enable network policy addon"
Expand All @@ -648,12 +654,6 @@ variable "remove_default_node_pool" {
default = false
}

variable "filestore_csi_driver" {
type = bool
description = "The status of the Filestore CSI driver addon, which allows the usage of filestore instance as volumes"
default = false
}

variable "disable_legacy_metadata_endpoints" {
type = bool
description = "Disable the /0.1/ and /v1beta1/ metadata server endpoints on the node. Changing this value will cause all node pools to be recreated."
Expand Down
8 changes: 4 additions & 4 deletions modules/beta-public-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,10 @@ resource "google_container_cluster" "primary" {
disabled = !var.horizontal_pod_autoscaling
}

gcp_filestore_csi_driver_config {
enabled = var.filestore_csi_driver
}

network_policy_config {
disabled = !var.network_policy
}
Expand All @@ -263,10 +267,6 @@ resource "google_container_cluster" "primary" {
enabled = var.dns_cache
}

gcp_filestore_csi_driver_config {
enabled = var.filestore_csi_driver
}

dynamic "gce_persistent_disk_csi_driver_config" {
for_each = local.cluster_gce_pd_csi_config

Expand Down
12 changes: 6 additions & 6 deletions modules/beta-public-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,12 @@ variable "enable_tpu" {
default = false
}

variable "filestore_csi_driver" {
type = bool
description = "The status of the Filestore CSI driver addon, which allows the usage of filestore instance as volumes"
default = false
}

variable "network_policy" {
type = bool
description = "Enable network policy addon"
Expand All @@ -648,12 +654,6 @@ variable "remove_default_node_pool" {
default = false
}

variable "filestore_csi_driver" {
type = bool
description = "The status of the Filestore CSI driver addon, which allows the usage of filestore instance as volumes"
default = false
}

variable "disable_legacy_metadata_endpoints" {
type = bool
description = "Disable the /0.1/ and /v1beta1/ metadata server endpoints on the node. Changing this value will cause all node pools to be recreated."
Expand Down
Loading