Skip to content

Commit 8694f80

Browse files
feat: add secret manager add-on config
Update all beta modules. "make build" Co-authored-by: Jayanta Dutta <jayanta.dutta@billhop.com>
1 parent 6820012 commit 8694f80

File tree

26 files changed

+128
-24
lines changed

26 files changed

+128
-24
lines changed

modules/beta-autopilot-private-cluster/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ Then perform the following commands on the root folder:
181181
| pod\_security\_policy\_enabled | Whether pod security policy is enabled |
182182
| region | Cluster region |
183183
| release\_channel | The release channel of this cluster |
184+
| secret\_manager\_addon\_enabled | Whether Secret Manager add-on is enabled |
184185
| service\_account | The service account to default running nodes as if not overridden in `node_pools`. |
185186
| tpu\_ipv4\_cidr\_block | The IP range in CIDR notation used for the TPUs |
186187
| type | Cluster type (regional / zonal) |

modules/beta-autopilot-private-cluster/main.tf

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,11 @@ locals {
9292
cluster_output_vertical_pod_autoscaling_enabled = google_container_cluster.primary.vertical_pod_autoscaling != null && length(google_container_cluster.primary.vertical_pod_autoscaling) == 1 ? google_container_cluster.primary.vertical_pod_autoscaling[0].enabled : false
9393

9494
# BETA features
95-
cluster_output_istio_disabled = google_container_cluster.primary.addons_config[0].istio_config != null && length(google_container_cluster.primary.addons_config[0].istio_config) == 1 ? google_container_cluster.primary.addons_config[0].istio_config[0].disabled : false
96-
cluster_output_pod_security_policy_enabled = google_container_cluster.primary.pod_security_policy_config != null && length(google_container_cluster.primary.pod_security_policy_config) == 1 ? google_container_cluster.primary.pod_security_policy_config[0].enabled : false
97-
cluster_output_intranode_visbility_enabled = google_container_cluster.primary.enable_intranode_visibility
98-
cluster_output_identity_service_enabled = google_container_cluster.primary.identity_service_config != null && length(google_container_cluster.primary.identity_service_config) == 1 ? google_container_cluster.primary.identity_service_config[0].enabled : false
95+
cluster_output_istio_disabled = google_container_cluster.primary.addons_config[0].istio_config != null && length(google_container_cluster.primary.addons_config[0].istio_config) == 1 ? google_container_cluster.primary.addons_config[0].istio_config[0].disabled : false
96+
cluster_output_pod_security_policy_enabled = google_container_cluster.primary.pod_security_policy_config != null && length(google_container_cluster.primary.pod_security_policy_config) == 1 ? google_container_cluster.primary.pod_security_policy_config[0].enabled : false
97+
cluster_output_intranode_visbility_enabled = google_container_cluster.primary.enable_intranode_visibility
98+
cluster_output_identity_service_enabled = google_container_cluster.primary.identity_service_config != null && length(google_container_cluster.primary.identity_service_config) == 1 ? google_container_cluster.primary.identity_service_config[0].enabled : false
99+
cluster_output_secret_manager_addon_enabled = google_container_cluster.primary.secret_manager_config != null && length(google_container_cluster.primary.secret_manager_config) == 1 ? google_container_cluster.primary.secret_manager_config[0].enabled : false
99100

100101
# /BETA features
101102

@@ -134,6 +135,7 @@ locals {
134135
cluster_pod_security_policy_enabled = local.cluster_output_pod_security_policy_enabled
135136
cluster_intranode_visibility_enabled = local.cluster_output_intranode_visbility_enabled
136137
cluster_identity_service_enabled = local.cluster_output_identity_service_enabled
138+
cluster_secret_manager_addon_enabled = local.cluster_output_secret_manager_addon_enabled
137139

138140
# /BETA features
139141

modules/beta-autopilot-private-cluster/outputs.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,11 @@ output "identity_service_enabled" {
189189
value = local.cluster_identity_service_enabled
190190
}
191191

192+
output "secret_manager_addon_enabled" {
193+
description = "Whether Secret Manager add-on is enabled"
194+
value = local.cluster_secret_manager_addon_enabled
195+
}
196+
192197
output "fleet_membership" {
193198
description = "Fleet membership (if registered)"
194199
value = local.fleet_membership

modules/beta-autopilot-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
| pod\_security\_policy\_enabled | Whether pod security policy is enabled |
169169
| region | Cluster region |
170170
| release\_channel | The release channel of this cluster |
171+
| secret\_manager\_addon\_enabled | Whether Secret Manager add-on is enabled |
171172
| service\_account | The service account to default running nodes as if not overridden in `node_pools`. |
172173
| tpu\_ipv4\_cidr\_block | The IP range in CIDR notation used for the TPUs |
173174
| type | Cluster type (regional / zonal) |

modules/beta-autopilot-public-cluster/main.tf

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,11 @@ locals {
9191
cluster_output_vertical_pod_autoscaling_enabled = google_container_cluster.primary.vertical_pod_autoscaling != null && length(google_container_cluster.primary.vertical_pod_autoscaling) == 1 ? google_container_cluster.primary.vertical_pod_autoscaling[0].enabled : false
9292

9393
# BETA features
94-
cluster_output_istio_disabled = google_container_cluster.primary.addons_config[0].istio_config != null && length(google_container_cluster.primary.addons_config[0].istio_config) == 1 ? google_container_cluster.primary.addons_config[0].istio_config[0].disabled : false
95-
cluster_output_pod_security_policy_enabled = google_container_cluster.primary.pod_security_policy_config != null && length(google_container_cluster.primary.pod_security_policy_config) == 1 ? google_container_cluster.primary.pod_security_policy_config[0].enabled : false
96-
cluster_output_intranode_visbility_enabled = google_container_cluster.primary.enable_intranode_visibility
97-
cluster_output_identity_service_enabled = google_container_cluster.primary.identity_service_config != null && length(google_container_cluster.primary.identity_service_config) == 1 ? google_container_cluster.primary.identity_service_config[0].enabled : false
94+
cluster_output_istio_disabled = google_container_cluster.primary.addons_config[0].istio_config != null && length(google_container_cluster.primary.addons_config[0].istio_config) == 1 ? google_container_cluster.primary.addons_config[0].istio_config[0].disabled : false
95+
cluster_output_pod_security_policy_enabled = google_container_cluster.primary.pod_security_policy_config != null && length(google_container_cluster.primary.pod_security_policy_config) == 1 ? google_container_cluster.primary.pod_security_policy_config[0].enabled : false
96+
cluster_output_intranode_visbility_enabled = google_container_cluster.primary.enable_intranode_visibility
97+
cluster_output_identity_service_enabled = google_container_cluster.primary.identity_service_config != null && length(google_container_cluster.primary.identity_service_config) == 1 ? google_container_cluster.primary.identity_service_config[0].enabled : false
98+
cluster_output_secret_manager_addon_enabled = google_container_cluster.primary.secret_manager_config != null && length(google_container_cluster.primary.secret_manager_config) == 1 ? google_container_cluster.primary.secret_manager_config[0].enabled : false
9899

99100
# /BETA features
100101

@@ -133,6 +134,7 @@ locals {
133134
cluster_pod_security_policy_enabled = local.cluster_output_pod_security_policy_enabled
134135
cluster_intranode_visibility_enabled = local.cluster_output_intranode_visbility_enabled
135136
cluster_identity_service_enabled = local.cluster_output_identity_service_enabled
137+
cluster_secret_manager_addon_enabled = local.cluster_output_secret_manager_addon_enabled
136138

137139
# /BETA features
138140

modules/beta-autopilot-public-cluster/outputs.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,11 @@ output "identity_service_enabled" {
179179
value = local.cluster_identity_service_enabled
180180
}
181181

182+
output "secret_manager_addon_enabled" {
183+
description = "Whether Secret Manager add-on is enabled"
184+
value = local.cluster_secret_manager_addon_enabled
185+
}
186+
182187
output "fleet_membership" {
183188
description = "Fleet membership (if registered)"
184189
value = local.fleet_membership

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ Then perform the following commands on the root folder:
212212
| enable\_private\_endpoint | Whether the master's internal IP address is used as the cluster endpoint | `bool` | `false` | no |
213213
| enable\_private\_nodes | Whether nodes have internal IP addresses only | `bool` | `false` | no |
214214
| enable\_resource\_consumption\_export | Whether to enable resource consumption metering on this cluster. When enabled, a table will be created in the resource export BigQuery dataset to store resource consumption data. The resulting table can be joined with the resource usage table or with BigQuery billing export. | `bool` | `true` | no |
215+
| enable\_secret\_manager\_addon | (Beta) Enable the Secret Manager add-on for this cluster | `bool` | `false` | no |
215216
| enable\_shielded\_nodes | Enable Shielded Nodes features on all nodes in this cluster | `bool` | `true` | no |
216217
| enable\_tpu | Enable Cloud TPU resources in the cluster. WARNING: changing this after cluster creation is destructive! | `bool` | `false` | no |
217218
| enable\_vertical\_pod\_autoscaling | Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it | `bool` | `false` | no |
@@ -329,6 +330,7 @@ Then perform the following commands on the root folder:
329330
| pod\_security\_policy\_enabled | Whether pod security policy is enabled |
330331
| region | Cluster region |
331332
| release\_channel | The release channel of this cluster |
333+
| secret\_manager\_addon\_enabled | Whether Secret Manager add-on is enabled |
332334
| service\_account | The service account to default running nodes as if not overridden in `node_pools`. |
333335
| tpu\_ipv4\_cidr\_block | The IP range in CIDR notation used for the TPUs |
334336
| type | Cluster type (regional / zonal) |

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,13 @@ resource "google_container_cluster" "primary" {
184184
enable_tpu = var.enable_tpu
185185
enable_intranode_visibility = var.enable_intranode_visibility
186186

187+
dynamic "secret_manager_config" {
188+
for_each = var.enable_secret_manager_addon ? [var.enable_secret_manager_addon] : []
189+
content {
190+
enabled = secret_manager_config.value
191+
}
192+
}
193+
187194
dynamic "pod_security_policy_config" {
188195
for_each = var.enable_pod_security_policy ? [var.enable_pod_security_policy] : []
189196
content {

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,11 @@ locals {
137137
cluster_output_vertical_pod_autoscaling_enabled = google_container_cluster.primary.vertical_pod_autoscaling != null && length(google_container_cluster.primary.vertical_pod_autoscaling) == 1 ? google_container_cluster.primary.vertical_pod_autoscaling[0].enabled : false
138138

139139
# BETA features
140-
cluster_output_istio_disabled = google_container_cluster.primary.addons_config[0].istio_config != null && length(google_container_cluster.primary.addons_config[0].istio_config) == 1 ? google_container_cluster.primary.addons_config[0].istio_config[0].disabled : false
141-
cluster_output_pod_security_policy_enabled = google_container_cluster.primary.pod_security_policy_config != null && length(google_container_cluster.primary.pod_security_policy_config) == 1 ? google_container_cluster.primary.pod_security_policy_config[0].enabled : false
142-
cluster_output_intranode_visbility_enabled = google_container_cluster.primary.enable_intranode_visibility
143-
cluster_output_identity_service_enabled = google_container_cluster.primary.identity_service_config != null && length(google_container_cluster.primary.identity_service_config) == 1 ? google_container_cluster.primary.identity_service_config[0].enabled : false
140+
cluster_output_istio_disabled = google_container_cluster.primary.addons_config[0].istio_config != null && length(google_container_cluster.primary.addons_config[0].istio_config) == 1 ? google_container_cluster.primary.addons_config[0].istio_config[0].disabled : false
141+
cluster_output_pod_security_policy_enabled = google_container_cluster.primary.pod_security_policy_config != null && length(google_container_cluster.primary.pod_security_policy_config) == 1 ? google_container_cluster.primary.pod_security_policy_config[0].enabled : false
142+
cluster_output_intranode_visbility_enabled = google_container_cluster.primary.enable_intranode_visibility
143+
cluster_output_identity_service_enabled = google_container_cluster.primary.identity_service_config != null && length(google_container_cluster.primary.identity_service_config) == 1 ? google_container_cluster.primary.identity_service_config[0].enabled : false
144+
cluster_output_secret_manager_addon_enabled = google_container_cluster.primary.secret_manager_config != null && length(google_container_cluster.primary.secret_manager_config) == 1 ? google_container_cluster.primary.secret_manager_config[0].enabled : false
144145

145146
# /BETA features
146147

@@ -196,6 +197,7 @@ locals {
196197
cluster_pod_security_policy_enabled = local.cluster_output_pod_security_policy_enabled
197198
cluster_intranode_visibility_enabled = local.cluster_output_intranode_visbility_enabled
198199
cluster_identity_service_enabled = local.cluster_output_identity_service_enabled
200+
cluster_secret_manager_addon_enabled = local.cluster_output_secret_manager_addon_enabled
199201

200202
# /BETA features
201203

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,11 @@ output "identity_service_enabled" {
215215
value = local.cluster_identity_service_enabled
216216
}
217217

218+
output "secret_manager_addon_enabled" {
219+
description = "Whether Secret Manager add-on is enabled"
220+
value = local.cluster_secret_manager_addon_enabled
221+
}
222+
218223
output "fleet_membership" {
219224
description = "Fleet membership (if registered)"
220225
value = local.fleet_membership

0 commit comments

Comments
 (0)