Skip to content

Commit 9e2b355

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 262c589 commit 9e2b355

File tree

26 files changed

+122
-18
lines changed

26 files changed

+122
-18
lines changed

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

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,10 @@ locals {
8989
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
9090

9191
# BETA features
92-
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
93-
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
94-
cluster_output_intranode_visbility_enabled = google_container_cluster.primary.enable_intranode_visibility
92+
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
93+
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
94+
cluster_output_intranode_visbility_enabled = google_container_cluster.primary.enable_intranode_visibility
95+
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
9596

9697
# /BETA features
9798

@@ -129,6 +130,7 @@ locals {
129130
cluster_istio_enabled = !local.cluster_output_istio_disabled
130131
cluster_pod_security_policy_enabled = local.cluster_output_pod_security_policy_enabled
131132
cluster_intranode_visibility_enabled = local.cluster_output_intranode_visbility_enabled
133+
cluster_secret_manager_addon_enabled = local.cluster_output_secret_manager_addon_enabled
132134

133135
# /BETA features
134136

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_pod_security_policy_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
@@ -164,6 +164,7 @@ Then perform the following commands on the root folder:
164164
| pod\_security\_policy\_enabled | Whether pod security policy is enabled |
165165
| region | Cluster region |
166166
| release\_channel | The release channel of this cluster |
167+
| secret\_manager\_addon\_enabled | Whether Secret Manager add-on is enabled |
167168
| service\_account | The service account to default running nodes as if not overridden in `node_pools`. |
168169
| tpu\_ipv4\_cidr\_block | The IP range in CIDR notation used for the TPUs |
169170
| type | Cluster type (regional / zonal) |

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,10 @@ locals {
8888
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
8989

9090
# BETA features
91-
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
92-
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
93-
cluster_output_intranode_visbility_enabled = google_container_cluster.primary.enable_intranode_visibility
91+
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
92+
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
93+
cluster_output_intranode_visbility_enabled = google_container_cluster.primary.enable_intranode_visibility
94+
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
9495

9596
# /BETA features
9697

@@ -128,6 +129,7 @@ locals {
128129
cluster_istio_enabled = !local.cluster_output_istio_disabled
129130
cluster_pod_security_policy_enabled = local.cluster_output_pod_security_policy_enabled
130131
cluster_intranode_visibility_enabled = local.cluster_output_intranode_visbility_enabled
132+
cluster_secret_manager_addon_enabled = local.cluster_output_secret_manager_addon_enabled
131133

132134
# /BETA features
133135

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_pod_security_policy_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
@@ -211,6 +211,7 @@ Then perform the following commands on the root folder:
211211
| enable\_private\_endpoint | Whether the master's internal IP address is used as the cluster endpoint | `bool` | `false` | no |
212212
| enable\_private\_nodes | Whether nodes have internal IP addresses only | `bool` | `false` | no |
213213
| 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 |
214+
| enable\_secret\_manager\_addon | (Beta) Enable the Secret Manager add-on for this cluster | `bool` | `false` | no |
214215
| enable\_shielded\_nodes | Enable Shielded Nodes features on all nodes in this cluster | `bool` | `true` | no |
215216
| enable\_tpu | Enable Cloud TPU resources in the cluster. WARNING: changing this after cluster creation is destructive! | `bool` | `false` | no |
216217
| enable\_vertical\_pod\_autoscaling | Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it | `bool` | `false` | no |
@@ -328,6 +329,7 @@ Then perform the following commands on the root folder:
328329
| pod\_security\_policy\_enabled | Whether pod security policy is enabled |
329330
| region | Cluster region |
330331
| release\_channel | The release channel of this cluster |
332+
| secret\_manager\_addon\_enabled | Whether Secret Manager add-on is enabled |
331333
| service\_account | The service account to default running nodes as if not overridden in `node_pools`. |
332334
| tpu\_ipv4\_cidr\_block | The IP range in CIDR notation used for the TPUs |
333335
| 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: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,10 @@ 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
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_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
143144

144145
# /BETA features
145146

@@ -194,6 +195,7 @@ locals {
194195
cluster_telemetry_type_is_set = var.cluster_telemetry_type != null
195196
cluster_pod_security_policy_enabled = local.cluster_output_pod_security_policy_enabled
196197
cluster_intranode_visibility_enabled = local.cluster_output_intranode_visbility_enabled
198+
cluster_secret_manager_addon_enabled = local.cluster_output_secret_manager_addon_enabled
197199

198200
# /BETA features
199201

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_pod_security_policy_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)