Skip to content

Commit cff4428

Browse files
authored
feat: add gke_backup_agent_config arg (#1316)
* add gke_backup_agent_config arg * CR comment
1 parent 487f33e commit cff4428

File tree

19 files changed

+79
-0
lines changed

19 files changed

+79
-0
lines changed

autogen/main/cluster.tf.tmpl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,14 @@ resource "google_container_cluster" "primary" {
248248
config_connector_config {
249249
enabled = var.config_connector
250250
}
251+
252+
dynamic "gke_backup_agent_config" {
253+
for_each = local.gke_backup_agent_config
254+
255+
content {
256+
enabled = gke_backup_agent_config.value.enabled
257+
}
258+
}
251259
{% endif %}
252260
}
253261

autogen/main/main.tf.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ locals {
108108
] : []
109109
cluster_cloudrun_enabled = var.cloudrun
110110
cluster_gce_pd_csi_config = var.gce_pd_csi_driver ? [{ enabled = true }] : [{ enabled = false }]
111+
gke_backup_agent_config = var.gke_backup_agent_config ? [{ enabled = true }] : [{ enabled = false }]
111112
logmon_config_is_set = length(var.logging_enabled_components) > 0 || length(var.monitoring_enabled_components) > 0 || var.monitoring_enable_managed_prometheus
112113
{% endif %}
113114

autogen/main/variables.tf.tmpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,12 @@ variable "config_connector" {
635635
default = false
636636
}
637637

638+
variable "gke_backup_agent_config" {
639+
type = bool
640+
description = "(Beta) Whether Backup for GKE agent is enabled for this cluster."
641+
default = false
642+
}
643+
638644
variable "cloudrun" {
639645
description = "(Beta) Enable CloudRun addon"
640646
default = false

modules/beta-private-cluster-update-variant/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ Then perform the following commands on the root folder:
199199
| 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 |
200200
| firewall\_priority | Priority rule for firewall rules | `number` | `1000` | no |
201201
| gce\_pd\_csi\_driver | (Beta) Whether this cluster should enable the Google Compute Engine Persistent Disk Container Storage Interface (CSI) Driver. | `bool` | `false` | no |
202+
| gke\_backup\_agent\_config | (Beta) Whether Backup for GKE agent is enabled for this cluster. | `bool` | `false` | no |
202203
| grant\_registry\_access | Grants created cluster-specific service account storage.objectViewer and artifactregistry.reader roles. | `bool` | `false` | no |
203204
| horizontal\_pod\_autoscaling | Enable horizontal pod autoscaling addon | `bool` | `true` | no |
204205
| http\_load\_balancing | Enable httpload balancer addon | `bool` | `true` | no |

modules/beta-private-cluster-update-variant/cluster.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,14 @@ resource "google_container_cluster" "primary" {
206206
config_connector_config {
207207
enabled = var.config_connector
208208
}
209+
210+
dynamic "gke_backup_agent_config" {
211+
for_each = local.gke_backup_agent_config
212+
213+
content {
214+
enabled = gke_backup_agent_config.value.enabled
215+
}
216+
}
209217
}
210218

211219
datapath_provider = var.datapath_provider

modules/beta-private-cluster-update-variant/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ locals {
9393
] : []
9494
cluster_cloudrun_enabled = var.cloudrun
9595
cluster_gce_pd_csi_config = var.gce_pd_csi_driver ? [{ enabled = true }] : [{ enabled = false }]
96+
gke_backup_agent_config = var.gke_backup_agent_config ? [{ enabled = true }] : [{ enabled = false }]
9697
logmon_config_is_set = length(var.logging_enabled_components) > 0 || length(var.monitoring_enabled_components) > 0 || var.monitoring_enable_managed_prometheus
9798

9899
cluster_authenticator_security_group = var.authenticator_security_group == null ? [] : [{

modules/beta-private-cluster-update-variant/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,12 @@ variable "config_connector" {
601601
default = false
602602
}
603603

604+
variable "gke_backup_agent_config" {
605+
type = bool
606+
description = "(Beta) Whether Backup for GKE agent is enabled for this cluster."
607+
default = false
608+
}
609+
604610
variable "cloudrun" {
605611
description = "(Beta) Enable CloudRun addon"
606612
default = false

modules/beta-private-cluster/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ Then perform the following commands on the root folder:
177177
| 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 |
178178
| firewall\_priority | Priority rule for firewall rules | `number` | `1000` | no |
179179
| gce\_pd\_csi\_driver | (Beta) Whether this cluster should enable the Google Compute Engine Persistent Disk Container Storage Interface (CSI) Driver. | `bool` | `false` | no |
180+
| gke\_backup\_agent\_config | (Beta) Whether Backup for GKE agent is enabled for this cluster. | `bool` | `false` | no |
180181
| grant\_registry\_access | Grants created cluster-specific service account storage.objectViewer and artifactregistry.reader roles. | `bool` | `false` | no |
181182
| horizontal\_pod\_autoscaling | Enable horizontal pod autoscaling addon | `bool` | `true` | no |
182183
| http\_load\_balancing | Enable httpload balancer addon | `bool` | `true` | no |

modules/beta-private-cluster/cluster.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,14 @@ resource "google_container_cluster" "primary" {
206206
config_connector_config {
207207
enabled = var.config_connector
208208
}
209+
210+
dynamic "gke_backup_agent_config" {
211+
for_each = local.gke_backup_agent_config
212+
213+
content {
214+
enabled = gke_backup_agent_config.value.enabled
215+
}
216+
}
209217
}
210218

211219
datapath_provider = var.datapath_provider

modules/beta-private-cluster/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ locals {
9393
] : []
9494
cluster_cloudrun_enabled = var.cloudrun
9595
cluster_gce_pd_csi_config = var.gce_pd_csi_driver ? [{ enabled = true }] : [{ enabled = false }]
96+
gke_backup_agent_config = var.gke_backup_agent_config ? [{ enabled = true }] : [{ enabled = false }]
9697
logmon_config_is_set = length(var.logging_enabled_components) > 0 || length(var.monitoring_enabled_components) > 0 || var.monitoring_enable_managed_prometheus
9798

9899
cluster_authenticator_security_group = var.authenticator_security_group == null ? [] : [{

modules/beta-private-cluster/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,12 @@ variable "config_connector" {
601601
default = false
602602
}
603603

604+
variable "gke_backup_agent_config" {
605+
type = bool
606+
description = "(Beta) Whether Backup for GKE agent is enabled for this cluster."
607+
default = false
608+
}
609+
604610
variable "cloudrun" {
605611
description = "(Beta) Enable CloudRun addon"
606612
default = false

modules/beta-public-cluster-update-variant/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ Then perform the following commands on the root folder:
190190
| 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 |
191191
| firewall\_priority | Priority rule for firewall rules | `number` | `1000` | no |
192192
| gce\_pd\_csi\_driver | (Beta) Whether this cluster should enable the Google Compute Engine Persistent Disk Container Storage Interface (CSI) Driver. | `bool` | `false` | no |
193+
| gke\_backup\_agent\_config | (Beta) Whether Backup for GKE agent is enabled for this cluster. | `bool` | `false` | no |
193194
| grant\_registry\_access | Grants created cluster-specific service account storage.objectViewer and artifactregistry.reader roles. | `bool` | `false` | no |
194195
| horizontal\_pod\_autoscaling | Enable horizontal pod autoscaling addon | `bool` | `true` | no |
195196
| http\_load\_balancing | Enable httpload balancer addon | `bool` | `true` | no |

modules/beta-public-cluster-update-variant/cluster.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,14 @@ resource "google_container_cluster" "primary" {
206206
config_connector_config {
207207
enabled = var.config_connector
208208
}
209+
210+
dynamic "gke_backup_agent_config" {
211+
for_each = local.gke_backup_agent_config
212+
213+
content {
214+
enabled = gke_backup_agent_config.value.enabled
215+
}
216+
}
209217
}
210218

211219
datapath_provider = var.datapath_provider

modules/beta-public-cluster-update-variant/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ locals {
9393
] : []
9494
cluster_cloudrun_enabled = var.cloudrun
9595
cluster_gce_pd_csi_config = var.gce_pd_csi_driver ? [{ enabled = true }] : [{ enabled = false }]
96+
gke_backup_agent_config = var.gke_backup_agent_config ? [{ enabled = true }] : [{ enabled = false }]
9697
logmon_config_is_set = length(var.logging_enabled_components) > 0 || length(var.monitoring_enabled_components) > 0 || var.monitoring_enable_managed_prometheus
9798

9899
cluster_authenticator_security_group = var.authenticator_security_group == null ? [] : [{

modules/beta-public-cluster-update-variant/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,12 @@ variable "config_connector" {
570570
default = false
571571
}
572572

573+
variable "gke_backup_agent_config" {
574+
type = bool
575+
description = "(Beta) Whether Backup for GKE agent is enabled for this cluster."
576+
default = false
577+
}
578+
573579
variable "cloudrun" {
574580
description = "(Beta) Enable CloudRun addon"
575581
default = false

modules/beta-public-cluster/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ Then perform the following commands on the root folder:
168168
| 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 |
169169
| firewall\_priority | Priority rule for firewall rules | `number` | `1000` | no |
170170
| gce\_pd\_csi\_driver | (Beta) Whether this cluster should enable the Google Compute Engine Persistent Disk Container Storage Interface (CSI) Driver. | `bool` | `false` | no |
171+
| gke\_backup\_agent\_config | (Beta) Whether Backup for GKE agent is enabled for this cluster. | `bool` | `false` | no |
171172
| grant\_registry\_access | Grants created cluster-specific service account storage.objectViewer and artifactregistry.reader roles. | `bool` | `false` | no |
172173
| horizontal\_pod\_autoscaling | Enable horizontal pod autoscaling addon | `bool` | `true` | no |
173174
| http\_load\_balancing | Enable httpload balancer addon | `bool` | `true` | no |

modules/beta-public-cluster/cluster.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,14 @@ resource "google_container_cluster" "primary" {
206206
config_connector_config {
207207
enabled = var.config_connector
208208
}
209+
210+
dynamic "gke_backup_agent_config" {
211+
for_each = local.gke_backup_agent_config
212+
213+
content {
214+
enabled = gke_backup_agent_config.value.enabled
215+
}
216+
}
209217
}
210218

211219
datapath_provider = var.datapath_provider

modules/beta-public-cluster/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ locals {
9393
] : []
9494
cluster_cloudrun_enabled = var.cloudrun
9595
cluster_gce_pd_csi_config = var.gce_pd_csi_driver ? [{ enabled = true }] : [{ enabled = false }]
96+
gke_backup_agent_config = var.gke_backup_agent_config ? [{ enabled = true }] : [{ enabled = false }]
9697
logmon_config_is_set = length(var.logging_enabled_components) > 0 || length(var.monitoring_enabled_components) > 0 || var.monitoring_enable_managed_prometheus
9798

9899
cluster_authenticator_security_group = var.authenticator_security_group == null ? [] : [{

modules/beta-public-cluster/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,12 @@ variable "config_connector" {
570570
default = false
571571
}
572572

573+
variable "gke_backup_agent_config" {
574+
type = bool
575+
description = "(Beta) Whether Backup for GKE agent is enabled for this cluster."
576+
default = false
577+
}
578+
573579
variable "cloudrun" {
574580
description = "(Beta) Enable CloudRun addon"
575581
default = false

0 commit comments

Comments
 (0)