Skip to content

Commit b33558a

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 7fd8d13 commit b33558a

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
@@ -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: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,11 @@ 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
95-
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
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_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
96+
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
9697

9798
# /BETA features
9899

@@ -131,6 +132,7 @@ locals {
131132
cluster_pod_security_policy_enabled = local.cluster_output_pod_security_policy_enabled
132133
cluster_intranode_visibility_enabled = local.cluster_output_intranode_visbility_enabled
133134
cluster_identity_service_enabled = local.cluster_output_identity_service_enabled
135+
cluster_secret_manager_addon_enabled = local.cluster_output_secret_manager_addon_enabled
134136

135137
# /BETA features
136138

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
@@ -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: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,11 @@ 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
94-
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
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_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_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

@@ -130,6 +131,7 @@ locals {
130131
cluster_pod_security_policy_enabled = local.cluster_output_pod_security_policy_enabled
131132
cluster_intranode_visibility_enabled = local.cluster_output_intranode_visbility_enabled
132133
cluster_identity_service_enabled = local.cluster_output_identity_service_enabled
134+
cluster_secret_manager_addon_enabled = local.cluster_output_secret_manager_addon_enabled
133135

134136
# /BETA features
135137

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
@@ -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: 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)