Skip to content

Commit 5c58d89

Browse files
authored
feat(TPG>=5.33)!: add secret manager add-on config to beta modules (#1977)
1 parent 3b0bbe8 commit 5c58d89

File tree

37 files changed

+162
-38
lines changed

37 files changed

+162
-38
lines changed

autogen/main/cluster.tf.tmpl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,13 @@ resource "google_container_cluster" "primary" {
221221
{% if beta_cluster %}
222222
enable_intranode_visibility = var.enable_intranode_visibility
223223

224+
dynamic "secret_manager_config" {
225+
for_each = var.enable_secret_manager_addon ? [var.enable_secret_manager_addon] : []
226+
content {
227+
enabled = secret_manager_config.value
228+
}
229+
}
230+
224231
dynamic "pod_security_policy_config" {
225232
for_each = var.enable_pod_security_policy ? [var.enable_pod_security_policy] : []
226233
content {

autogen/main/main.tf.tmpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ locals {
169169
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
170170
cluster_output_intranode_visbility_enabled = google_container_cluster.primary.enable_intranode_visibility
171171
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
172+
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
172173

173174
# /BETA features
174175
{% endif %}
@@ -239,6 +240,7 @@ locals {
239240
cluster_pod_security_policy_enabled = local.cluster_output_pod_security_policy_enabled
240241
cluster_intranode_visibility_enabled = local.cluster_output_intranode_visbility_enabled
241242
cluster_identity_service_enabled = local.cluster_output_identity_service_enabled
243+
cluster_secret_manager_addon_enabled = local.cluster_output_secret_manager_addon_enabled
242244

243245
# /BETA features
244246
{% endif %}

autogen/main/outputs.tf.tmpl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,11 @@ output "identity_service_enabled" {
233233
description = "Whether Identity Service is enabled"
234234
value = local.cluster_identity_service_enabled
235235
}
236+
237+
output "secret_manager_addon_enabled" {
238+
description = "Whether Secret Manager add-on is enabled"
239+
value = local.cluster_secret_manager_addon_enabled
240+
}
236241
{% endif %}
237242

238243
output "fleet_membership" {

autogen/main/variables.tf.tmpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -862,6 +862,12 @@ variable "enable_pod_security_policy" {
862862
default = false
863863
}
864864

865+
variable "enable_secret_manager_addon" {
866+
description = "(Beta) Enable the Secret Manager add-on for this cluster"
867+
type = bool
868+
default = false
869+
}
870+
865871
variable "sandbox_enabled" {
866872
type = bool
867873
description = "(Beta) Enable GKE Sandbox (Do not forget to set `image_type` = `COS_CONTAINERD` to use it)."

autogen/main/versions.tf.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ terraform {
2424
required_providers {
2525
google = {
2626
source = "hashicorp/google"
27-
version = ">= 5.25.0, < 6"
27+
version = ">= 5.33.0, < 6"
2828
}
2929
google-beta = {
3030
source = "hashicorp/google-beta"
31-
version = ">= 5.25.0, < 6"
31+
version = ">= 5.33.0, < 6"
3232
}
3333
kubernetes = {
3434
source = "hashicorp/kubernetes"

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-private-cluster/versions.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ terraform {
2121
required_providers {
2222
google = {
2323
source = "hashicorp/google"
24-
version = ">= 5.25.0, < 6"
24+
version = ">= 5.33.0, < 6"
2525
}
2626
google-beta = {
2727
source = "hashicorp/google-beta"
28-
version = ">= 5.25.0, < 6"
28+
version = ">= 5.33.0, < 6"
2929
}
3030
kubernetes = {
3131
source = "hashicorp/kubernetes"

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

0 commit comments

Comments
 (0)