Skip to content

Commit 5fb077d

Browse files
feat: Allow enabling GKE backup agent for safer cluster variants (terraform-google-modules#1367)
* Allow enabling GKE backup agent for safer cluster variants * fix extra attrib from merge conflict Co-authored-by: Bharath KKB <[email protected]>
1 parent 4e817be commit 5fb077d

File tree

8 files changed

+32
-6
lines changed

8 files changed

+32
-6
lines changed

autogen/safer-cluster/main.tf.tmpl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,14 +141,16 @@ module "gke" {
141141

142142
dns_cache = var.dns_cache
143143

144+
145+
config_connector = var.config_connector
146+
gke_backup_agent_config = var.gke_backup_agent_config
147+
144148
cluster_dns_provider = var.cluster_dns_provider
145149

146150
cluster_dns_scope = var.cluster_dns_scope
147151

148152
cluster_dns_domain = var.cluster_dns_domain
149153

150-
config_connector = var.config_connector
151-
152154
default_max_pods_per_node = var.default_max_pods_per_node
153155

154156
database_encryption = var.database_encryption

autogen/safer-cluster/variables.tf.tmpl

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

421+
variable "gke_backup_agent_config" {
422+
type = bool
423+
description = "(Beta) Whether Backup for GKE agent is enabled for this cluster."
424+
default = false
425+
}
426+
421427
variable "disable_default_snat" {
422428
type = bool
423429
description = "Whether to disable the default SNAT to support the private use of public IP addresses"

modules/safer-cluster-update-variant/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ For simplicity, we suggest using `roles/container.admin` and
227227
| firewall\_inbound\_ports | List of TCP ports for admission/webhook controllers | `list(string)` | <pre>[<br> "8443",<br> "9443",<br> "15017"<br>]</pre> | no |
228228
| firewall\_priority | Priority rule for firewall rules | `number` | `1000` | no |
229229
| gce\_pd\_csi\_driver | (Beta) Whether this cluster should enable the Google Compute Engine Persistent Disk Container Storage Interface (CSI) Driver. | `bool` | `true` | no |
230+
| gke\_backup\_agent\_config | (Beta) Whether Backup for GKE agent is enabled for this cluster. | `bool` | `false` | no |
230231
| grant\_registry\_access | Grants created cluster-specific service account storage.objectViewer role. | `bool` | `true` | no |
231232
| horizontal\_pod\_autoscaling | Enable horizontal pod autoscaling addon | `bool` | `true` | no |
232233
| http\_load\_balancing | Enable httpload balancer addon. The addon allows whoever can create Ingress objects to expose an application to a public IP. Network policies or Gatekeeper policies should be used to verify that only authorized applications are exposed. | `bool` | `true` | no |

modules/safer-cluster-update-variant/main.tf

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,16 @@ module "gke" {
137137

138138
dns_cache = var.dns_cache
139139

140+
141+
config_connector = var.config_connector
142+
gke_backup_agent_config = var.gke_backup_agent_config
143+
140144
cluster_dns_provider = var.cluster_dns_provider
141145

142146
cluster_dns_scope = var.cluster_dns_scope
143147

144148
cluster_dns_domain = var.cluster_dns_domain
145149

146-
config_connector = var.config_connector
147-
148150
default_max_pods_per_node = var.default_max_pods_per_node
149151

150152
database_encryption = var.database_encryption

modules/safer-cluster-update-variant/variables.tf

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

421+
variable "gke_backup_agent_config" {
422+
type = bool
423+
description = "(Beta) Whether Backup for GKE agent is enabled for this cluster."
424+
default = false
425+
}
426+
421427
variable "disable_default_snat" {
422428
type = bool
423429
description = "Whether to disable the default SNAT to support the private use of public IP addresses"

modules/safer-cluster/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ For simplicity, we suggest using `roles/container.admin` and
227227
| firewall\_inbound\_ports | List of TCP ports for admission/webhook controllers | `list(string)` | <pre>[<br> "8443",<br> "9443",<br> "15017"<br>]</pre> | no |
228228
| firewall\_priority | Priority rule for firewall rules | `number` | `1000` | no |
229229
| gce\_pd\_csi\_driver | (Beta) Whether this cluster should enable the Google Compute Engine Persistent Disk Container Storage Interface (CSI) Driver. | `bool` | `true` | no |
230+
| gke\_backup\_agent\_config | (Beta) Whether Backup for GKE agent is enabled for this cluster. | `bool` | `false` | no |
230231
| grant\_registry\_access | Grants created cluster-specific service account storage.objectViewer role. | `bool` | `true` | no |
231232
| horizontal\_pod\_autoscaling | Enable horizontal pod autoscaling addon | `bool` | `true` | no |
232233
| http\_load\_balancing | Enable httpload balancer addon. The addon allows whoever can create Ingress objects to expose an application to a public IP. Network policies or Gatekeeper policies should be used to verify that only authorized applications are exposed. | `bool` | `true` | no |

modules/safer-cluster/main.tf

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,16 @@ module "gke" {
137137

138138
dns_cache = var.dns_cache
139139

140+
141+
config_connector = var.config_connector
142+
gke_backup_agent_config = var.gke_backup_agent_config
143+
140144
cluster_dns_provider = var.cluster_dns_provider
141145

142146
cluster_dns_scope = var.cluster_dns_scope
143147

144148
cluster_dns_domain = var.cluster_dns_domain
145149

146-
config_connector = var.config_connector
147-
148150
default_max_pods_per_node = var.default_max_pods_per_node
149151

150152
database_encryption = var.database_encryption

modules/safer-cluster/variables.tf

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

421+
variable "gke_backup_agent_config" {
422+
type = bool
423+
description = "(Beta) Whether Backup for GKE agent is enabled for this cluster."
424+
default = false
425+
}
426+
421427
variable "disable_default_snat" {
422428
type = bool
423429
description = "Whether to disable the default SNAT to support the private use of public IP addresses"

0 commit comments

Comments
 (0)