Skip to content

Commit

Permalink
feat!: promote gke_backup_agent_config to ga (#1513)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tolsee authored Jan 14, 2023
1 parent d7f71f6 commit 966135f
Show file tree
Hide file tree
Showing 40 changed files with 136 additions and 86 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ Then perform the following commands on the root folder:
| firewall\_priority | Priority rule for firewall rules | `number` | `1000` | no |
| gateway\_api\_channel | The gateway api channel of this cluster. Accepted values are `CHANNEL_STANDARD` and `CHANNEL_DISABLED`. | `string` | `null` | no |
| gce\_pd\_csi\_driver | Whether this cluster should enable the Google Compute Engine Persistent Disk Container Storage Interface (CSI) Driver. | `bool` | `true` | no |
| gke\_backup\_agent\_config | Whether Backup for GKE agent is enabled for this cluster. | `bool` | `false` | no |
| grant\_registry\_access | Grants created cluster-specific service account storage.objectViewer and artifactregistry.reader roles. | `bool` | `false` | no |
| horizontal\_pod\_autoscaling | Enable horizontal pod autoscaling addon | `bool` | `true` | no |
| http\_load\_balancing | Enable httpload balancer addon | `bool` | `true` | no |
Expand Down
16 changes: 8 additions & 8 deletions autogen/main/cluster.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,14 @@ resource "google_container_cluster" "primary" {
enabled = gce_persistent_disk_csi_driver_config.value.enabled
}
}

dynamic "gke_backup_agent_config" {
for_each = local.gke_backup_agent_config

content {
enabled = gke_backup_agent_config.value.enabled
}
}
{% endif %}
{% if beta_cluster and autopilot_cluster != true %}

Expand All @@ -282,14 +290,6 @@ resource "google_container_cluster" "primary" {
config_connector_config {
enabled = var.config_connector
}

dynamic "gke_backup_agent_config" {
for_each = local.gke_backup_agent_config

content {
enabled = gke_backup_agent_config.value.enabled
}
}
{% endif %}
}

Expand Down
2 changes: 1 addition & 1 deletion autogen/main/main.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ locals {
}]
cluster_gce_pd_csi_config = var.gce_pd_csi_driver ? [{ enabled = true }] : [{ enabled = false }]
logmon_config_is_set = length(var.logging_enabled_components) > 0 || length(var.monitoring_enabled_components) > 0 || var.monitoring_enable_managed_prometheus
gke_backup_agent_config = var.gke_backup_agent_config ? [{ enabled = true }] : [{ enabled = false }]
{% endif %}
{% if beta_cluster and autopilot_cluster != true %}
cluster_cloudrun_config_load_balancer_config = (var.cloudrun && var.cloudrun_load_balancer_type != "") ? {
Expand All @@ -117,7 +118,6 @@ locals {
)
] : []
cluster_cloudrun_enabled = var.cloudrun
gke_backup_agent_config = var.gke_backup_agent_config ? [{ enabled = true }] : [{ enabled = false }]
{% endif %}

cluster_authenticator_security_group = var.authenticator_security_group == null ? [] : [{
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 @@ -641,6 +641,12 @@ variable "gce_pd_csi_driver" {
default = true
}

variable "gke_backup_agent_config" {
type = bool
description = "Whether Backup for GKE agent is enabled for this cluster."
default = false
}

{% endif %}
variable "timeouts" {
type = map(string)
Expand Down Expand Up @@ -703,12 +709,6 @@ variable "config_connector" {
default = false
}

variable "gke_backup_agent_config" {
type = bool
description = "(Beta) Whether Backup for GKE agent is enabled for this cluster."
default = false
}

variable "cloudrun" {
description = "(Beta) Enable CloudRun addon"
default = false
Expand Down
2 changes: 1 addition & 1 deletion autogen/main/versions.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ terraform {
required_providers {
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.46.0, < 5.0"
version = ">= 4.47.0, < 5.0"
}
kubernetes = {
source = "hashicorp/kubernetes"
Expand Down
8 changes: 8 additions & 0 deletions cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,14 @@ resource "google_container_cluster" "primary" {
enabled = gce_persistent_disk_csi_driver_config.value.enabled
}
}

dynamic "gke_backup_agent_config" {
for_each = local.gke_backup_agent_config

content {
enabled = gke_backup_agent_config.value.enabled
}
}
}

datapath_provider = var.datapath_provider
Expand Down
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ locals {
}]
cluster_gce_pd_csi_config = var.gce_pd_csi_driver ? [{ enabled = true }] : [{ enabled = false }]
logmon_config_is_set = length(var.logging_enabled_components) > 0 || length(var.monitoring_enabled_components) > 0 || var.monitoring_enable_managed_prometheus
gke_backup_agent_config = var.gke_backup_agent_config ? [{ enabled = true }] : [{ enabled = false }]

cluster_authenticator_security_group = var.authenticator_security_group == null ? [] : [{
security_group = var.authenticator_security_group
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-autopilot-private-cluster/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ terraform {
required_providers {
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.46.0, < 5.0"
version = ">= 4.47.0, < 5.0"
}
kubernetes = {
source = "hashicorp/kubernetes"
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-autopilot-public-cluster/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ terraform {
required_providers {
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.46.0, < 5.0"
version = ">= 4.47.0, < 5.0"
}
kubernetes = {
source = "hashicorp/kubernetes"
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-private-cluster-update-variant/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ Then perform the following commands on the root folder:
| firewall\_priority | Priority rule for firewall rules | `number` | `1000` | no |
| gateway\_api\_channel | The gateway api channel of this cluster. Accepted values are `CHANNEL_STANDARD` and `CHANNEL_DISABLED`. | `string` | `null` | no |
| gce\_pd\_csi\_driver | Whether this cluster should enable the Google Compute Engine Persistent Disk Container Storage Interface (CSI) Driver. | `bool` | `true` | no |
| gke\_backup\_agent\_config | (Beta) Whether Backup for GKE agent is enabled for this cluster. | `bool` | `false` | no |
| gke\_backup\_agent\_config | Whether Backup for GKE agent is enabled for this cluster. | `bool` | `false` | no |
| grant\_registry\_access | Grants created cluster-specific service account storage.objectViewer and artifactregistry.reader roles. | `bool` | `false` | no |
| horizontal\_pod\_autoscaling | Enable horizontal pod autoscaling addon | `bool` | `true` | no |
| http\_load\_balancing | Enable httpload balancer addon | `bool` | `true` | no |
Expand Down
16 changes: 8 additions & 8 deletions modules/beta-private-cluster-update-variant/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,14 @@ resource "google_container_cluster" "primary" {
}
}

dynamic "gke_backup_agent_config" {
for_each = local.gke_backup_agent_config

content {
enabled = gke_backup_agent_config.value.enabled
}
}

istio_config {
disabled = !var.istio
auth = var.istio_auth
Expand All @@ -237,14 +245,6 @@ resource "google_container_cluster" "primary" {
config_connector_config {
enabled = var.config_connector
}

dynamic "gke_backup_agent_config" {
for_each = local.gke_backup_agent_config

content {
enabled = gke_backup_agent_config.value.enabled
}
}
}

datapath_provider = var.datapath_provider
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-private-cluster-update-variant/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ locals {
}]
cluster_gce_pd_csi_config = var.gce_pd_csi_driver ? [{ enabled = true }] : [{ enabled = false }]
logmon_config_is_set = length(var.logging_enabled_components) > 0 || length(var.monitoring_enabled_components) > 0 || var.monitoring_enable_managed_prometheus
gke_backup_agent_config = var.gke_backup_agent_config ? [{ enabled = true }] : [{ enabled = false }]
cluster_cloudrun_config_load_balancer_config = (var.cloudrun && var.cloudrun_load_balancer_type != "") ? {
load_balancer_type = var.cloudrun_load_balancer_type
} : {}
Expand All @@ -98,7 +99,6 @@ locals {
)
] : []
cluster_cloudrun_enabled = var.cloudrun
gke_backup_agent_config = var.gke_backup_agent_config ? [{ enabled = true }] : [{ enabled = false }]

cluster_authenticator_security_group = var.authenticator_security_group == null ? [] : [{
security_group = var.authenticator_security_group
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 @@ -614,6 +614,12 @@ variable "gce_pd_csi_driver" {
default = true
}

variable "gke_backup_agent_config" {
type = bool
description = "Whether Backup for GKE agent is enabled for this cluster."
default = false
}

variable "timeouts" {
type = map(string)
description = "Timeout for cluster operations."
Expand Down Expand Up @@ -671,12 +677,6 @@ variable "config_connector" {
default = false
}

variable "gke_backup_agent_config" {
type = bool
description = "(Beta) Whether Backup for GKE agent is enabled for this cluster."
default = false
}

variable "cloudrun" {
description = "(Beta) Enable CloudRun addon"
default = false
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-private-cluster-update-variant/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ terraform {
required_providers {
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.46.0, < 5.0"
version = ">= 4.47.0, < 5.0"
}
kubernetes = {
source = "hashicorp/kubernetes"
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-private-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ Then perform the following commands on the root folder:
| firewall\_priority | Priority rule for firewall rules | `number` | `1000` | no |
| gateway\_api\_channel | The gateway api channel of this cluster. Accepted values are `CHANNEL_STANDARD` and `CHANNEL_DISABLED`. | `string` | `null` | no |
| gce\_pd\_csi\_driver | Whether this cluster should enable the Google Compute Engine Persistent Disk Container Storage Interface (CSI) Driver. | `bool` | `true` | no |
| gke\_backup\_agent\_config | (Beta) Whether Backup for GKE agent is enabled for this cluster. | `bool` | `false` | no |
| gke\_backup\_agent\_config | Whether Backup for GKE agent is enabled for this cluster. | `bool` | `false` | no |
| grant\_registry\_access | Grants created cluster-specific service account storage.objectViewer and artifactregistry.reader roles. | `bool` | `false` | no |
| horizontal\_pod\_autoscaling | Enable horizontal pod autoscaling addon | `bool` | `true` | no |
| http\_load\_balancing | Enable httpload balancer addon | `bool` | `true` | no |
Expand Down
16 changes: 8 additions & 8 deletions modules/beta-private-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,14 @@ resource "google_container_cluster" "primary" {
}
}

dynamic "gke_backup_agent_config" {
for_each = local.gke_backup_agent_config

content {
enabled = gke_backup_agent_config.value.enabled
}
}

istio_config {
disabled = !var.istio
auth = var.istio_auth
Expand All @@ -237,14 +245,6 @@ resource "google_container_cluster" "primary" {
config_connector_config {
enabled = var.config_connector
}

dynamic "gke_backup_agent_config" {
for_each = local.gke_backup_agent_config

content {
enabled = gke_backup_agent_config.value.enabled
}
}
}

datapath_provider = var.datapath_provider
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-private-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ locals {
}]
cluster_gce_pd_csi_config = var.gce_pd_csi_driver ? [{ enabled = true }] : [{ enabled = false }]
logmon_config_is_set = length(var.logging_enabled_components) > 0 || length(var.monitoring_enabled_components) > 0 || var.monitoring_enable_managed_prometheus
gke_backup_agent_config = var.gke_backup_agent_config ? [{ enabled = true }] : [{ enabled = false }]
cluster_cloudrun_config_load_balancer_config = (var.cloudrun && var.cloudrun_load_balancer_type != "") ? {
load_balancer_type = var.cloudrun_load_balancer_type
} : {}
Expand All @@ -98,7 +99,6 @@ locals {
)
] : []
cluster_cloudrun_enabled = var.cloudrun
gke_backup_agent_config = var.gke_backup_agent_config ? [{ enabled = true }] : [{ enabled = false }]

cluster_authenticator_security_group = var.authenticator_security_group == null ? [] : [{
security_group = var.authenticator_security_group
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 @@ -614,6 +614,12 @@ variable "gce_pd_csi_driver" {
default = true
}

variable "gke_backup_agent_config" {
type = bool
description = "Whether Backup for GKE agent is enabled for this cluster."
default = false
}

variable "timeouts" {
type = map(string)
description = "Timeout for cluster operations."
Expand Down Expand Up @@ -671,12 +677,6 @@ variable "config_connector" {
default = false
}

variable "gke_backup_agent_config" {
type = bool
description = "(Beta) Whether Backup for GKE agent is enabled for this cluster."
default = false
}

variable "cloudrun" {
description = "(Beta) Enable CloudRun addon"
default = false
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-private-cluster/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ terraform {
required_providers {
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.46.0, < 5.0"
version = ">= 4.47.0, < 5.0"
}
kubernetes = {
source = "hashicorp/kubernetes"
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-public-cluster-update-variant/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ Then perform the following commands on the root folder:
| firewall\_priority | Priority rule for firewall rules | `number` | `1000` | no |
| gateway\_api\_channel | The gateway api channel of this cluster. Accepted values are `CHANNEL_STANDARD` and `CHANNEL_DISABLED`. | `string` | `null` | no |
| gce\_pd\_csi\_driver | Whether this cluster should enable the Google Compute Engine Persistent Disk Container Storage Interface (CSI) Driver. | `bool` | `true` | no |
| gke\_backup\_agent\_config | (Beta) Whether Backup for GKE agent is enabled for this cluster. | `bool` | `false` | no |
| gke\_backup\_agent\_config | Whether Backup for GKE agent is enabled for this cluster. | `bool` | `false` | no |
| grant\_registry\_access | Grants created cluster-specific service account storage.objectViewer and artifactregistry.reader roles. | `bool` | `false` | no |
| horizontal\_pod\_autoscaling | Enable horizontal pod autoscaling addon | `bool` | `true` | no |
| http\_load\_balancing | Enable httpload balancer addon | `bool` | `true` | no |
Expand Down
16 changes: 8 additions & 8 deletions modules/beta-public-cluster-update-variant/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,14 @@ resource "google_container_cluster" "primary" {
}
}

dynamic "gke_backup_agent_config" {
for_each = local.gke_backup_agent_config

content {
enabled = gke_backup_agent_config.value.enabled
}
}

istio_config {
disabled = !var.istio
auth = var.istio_auth
Expand All @@ -237,14 +245,6 @@ resource "google_container_cluster" "primary" {
config_connector_config {
enabled = var.config_connector
}

dynamic "gke_backup_agent_config" {
for_each = local.gke_backup_agent_config

content {
enabled = gke_backup_agent_config.value.enabled
}
}
}

datapath_provider = var.datapath_provider
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-public-cluster-update-variant/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ locals {
}]
cluster_gce_pd_csi_config = var.gce_pd_csi_driver ? [{ enabled = true }] : [{ enabled = false }]
logmon_config_is_set = length(var.logging_enabled_components) > 0 || length(var.monitoring_enabled_components) > 0 || var.monitoring_enable_managed_prometheus
gke_backup_agent_config = var.gke_backup_agent_config ? [{ enabled = true }] : [{ enabled = false }]
cluster_cloudrun_config_load_balancer_config = (var.cloudrun && var.cloudrun_load_balancer_type != "") ? {
load_balancer_type = var.cloudrun_load_balancer_type
} : {}
Expand All @@ -98,7 +99,6 @@ locals {
)
] : []
cluster_cloudrun_enabled = var.cloudrun
gke_backup_agent_config = var.gke_backup_agent_config ? [{ enabled = true }] : [{ enabled = false }]

cluster_authenticator_security_group = var.authenticator_security_group == null ? [] : [{
security_group = var.authenticator_security_group
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 @@ -584,6 +584,12 @@ variable "gce_pd_csi_driver" {
default = true
}

variable "gke_backup_agent_config" {
type = bool
description = "Whether Backup for GKE agent is enabled for this cluster."
default = false
}

variable "timeouts" {
type = map(string)
description = "Timeout for cluster operations."
Expand Down Expand Up @@ -641,12 +647,6 @@ variable "config_connector" {
default = false
}

variable "gke_backup_agent_config" {
type = bool
description = "(Beta) Whether Backup for GKE agent is enabled for this cluster."
default = false
}

variable "cloudrun" {
description = "(Beta) Enable CloudRun addon"
default = false
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-public-cluster-update-variant/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ terraform {
required_providers {
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.46.0, < 5.0"
version = ">= 4.47.0, < 5.0"
}
kubernetes = {
source = "hashicorp/kubernetes"
Expand Down
Loading

0 comments on commit 966135f

Please sign in to comment.