Skip to content

Commit 622c2f6

Browse files
committed
enable_mesh_certificates for autogen/main
1 parent 998043f commit 622c2f6

File tree

4 files changed

+31
-0
lines changed

4 files changed

+31
-0
lines changed

autogen/main/cluster.tf.tmpl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,17 @@ resource "google_container_cluster" "primary" {
506506
}
507507
{% endif %}
508508

509+
{% if autopilot_cluster != true %}
510+
dynamic "mesh_certificates" {
511+
for_each = local.cluster_mesh_certificates_config
512+
513+
content {
514+
enable_certificates = mesh_certificates.value.enable_certificates
515+
}
516+
}
517+
{% endif %}
518+
519+
509520
dynamic "authenticator_groups_config" {
510521
for_each = local.cluster_authenticator_security_group
511522
content {

autogen/main/main.tf.tmpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,11 @@ locals {
213213
workload_identity_enabled = ! (var.identity_namespace == null || var.identity_namespace == "null")
214214
cluster_workload_identity_config = ! local.workload_identity_enabled ? [] : var.identity_namespace == "enabled" ? [{
215215
workload_pool = "${var.project_id}.svc.id.goog" }] : [{ workload_pool = var.identity_namespace
216+
}]
217+
cluster_mesh_certificates_config = ! local.workload_identity_enabled ? [] : [{
218+
enable_certificates = var.enable_mesh_certificates
216219
}]
220+
217221
{% if beta_cluster %}
218222
# BETA features
219223
cluster_istio_enabled = ! local.cluster_output_istio_disabled

autogen/main/outputs.tf.tmpl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,14 @@ output "identity_namespace" {
170170
google_container_cluster.primary
171171
]
172172
}
173+
174+
output "mesh_certificates_config" {
175+
description = "Mesh certificates configuration"
176+
value = local.cluster_mesh_certificates_config
177+
depends_on = [
178+
google_container_cluster.primary
179+
]
180+
}
173181
{% if private_cluster %}
174182

175183
output "master_ipv4_cidr_block" {

autogen/main/variables.tf.tmpl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -777,5 +777,13 @@ variable "enable_identity_service" {
777777
description = "Enable the Identity Service component, which allows customers to use external identity providers with the K8S API."
778778
default = false
779779
}
780+
781+
782+
variable "enable_mesh_certificates" {
783+
type = bool
784+
default = false
785+
description = "Controls the issuance of workload mTLS certificates. When enabled the GKE Workload Identity Certificates controller and node agent will be deployed in the cluster. Requires Workload Identity."
786+
}
780787
{% endif %}
781788
{% endif %}
789+

0 commit comments

Comments
 (0)