Skip to content

Commit 9d6a400

Browse files
DrFaust92apeabody
andauthored
feat: bump identity_service_config to ga (#1997)
Co-authored-by: Andrew Peabody <andrewpeabody@google.com>
1 parent 9ae8b38 commit 9d6a400

File tree

41 files changed

+175
-105
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+175
-105
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ Then perform the following commands on the root folder:
165165
| enable\_cilium\_clusterwide\_network\_policy | Enable Cilium Cluster Wide Network Policies on the cluster | `bool` | `false` | no |
166166
| enable\_confidential\_nodes | An optional flag to enable confidential node config. | `bool` | `false` | no |
167167
| enable\_cost\_allocation | Enables Cost Allocation Feature and the cluster name and namespace of your GKE workloads appear in the labels field of the billing export to BigQuery | `bool` | `false` | no |
168+
| enable\_identity\_service | Enable the Identity Service component, which allows customers to use external identity providers with the K8S API. | `bool` | `false` | no |
168169
| enable\_intranode\_visibility | Whether Intra-node visibility is enabled for this cluster. This makes same node pod to pod traffic visible for VPC network | `bool` | `false` | no |
169170
| enable\_kubernetes\_alpha | Whether to enable Kubernetes Alpha features for this cluster. Note that when this option is enabled, the cluster cannot be upgraded and will be automatically deleted after 30 days. | `bool` | `false` | no |
170171
| enable\_l4\_ilb\_subsetting | Enable L4 ILB Subsetting on the cluster | `bool` | `false` | no |
@@ -259,6 +260,7 @@ Then perform the following commands on the root folder:
259260
| horizontal\_pod\_autoscaling\_enabled | Whether horizontal pod autoscaling enabled |
260261
| http\_load\_balancing\_enabled | Whether http load balancing enabled |
261262
| identity\_namespace | Workload Identity pool |
263+
| identity\_service\_enabled | Whether Identity Service is enabled |
262264
| instance\_group\_urls | List of GKE generated instance groups |
263265
| intranode\_visibility\_enabled | Whether intra-node visibility is enabled |
264266
| location | Cluster location (region if regional cluster, zone if zonal cluster) |

autogen/main/cluster.tf.tmpl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,13 @@ resource "google_container_cluster" "primary" {
216216
}
217217
}
218218

219+
dynamic "identity_service_config" {
220+
for_each = var.enable_identity_service ? [var.enable_identity_service] : []
221+
content {
222+
enabled = identity_service_config.value
223+
}
224+
}
225+
219226
enable_kubernetes_alpha = var.enable_kubernetes_alpha
220227
enable_tpu = var.enable_tpu
221228
enable_intranode_visibility = var.enable_intranode_visibility
@@ -234,13 +241,6 @@ resource "google_container_cluster" "primary" {
234241
enabled = pod_security_policy_config.value
235242
}
236243
}
237-
238-
dynamic "identity_service_config" {
239-
for_each = var.enable_identity_service ? [var.enable_identity_service] : []
240-
content {
241-
enabled = identity_service_config.value
242-
}
243-
}
244244
{% endif %}
245245
{% endif %}
246246

autogen/main/main.tf.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,12 @@ locals {
163163
cluster_output_horizontal_pod_autoscaling_enabled = coalescelist(lookup(coalescelist(google_container_cluster.primary.addons_config, [{}])[0], "horizontal_pod_autoscaling", [{}]), [{ disabled=false }])[0].disabled
164164
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
165165
cluster_output_intranode_visbility_enabled = google_container_cluster.primary.enable_intranode_visibility
166+
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
166167

167168
{% if beta_cluster %}
168169
# BETA features
169170
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
170171
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
171-
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
172172
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
173173

174174
# /BETA features
@@ -226,6 +226,7 @@ locals {
226226
}]
227227
confidential_node_config = var.enable_confidential_nodes == true ? [{ enabled = true }] : []
228228
cluster_intranode_visibility_enabled = local.cluster_output_intranode_visbility_enabled
229+
cluster_identity_service_enabled = local.cluster_output_identity_service_enabled
229230
{% if autopilot_cluster != true %}
230231
cluster_mesh_certificates_config = local.workload_identity_enabled ? [{
231232
enable_certificates = var.enable_mesh_certificates
@@ -239,7 +240,6 @@ locals {
239240
cluster_telemetry_type_is_set = var.cluster_telemetry_type != null
240241
{% endif %}
241242
cluster_pod_security_policy_enabled = local.cluster_output_pod_security_policy_enabled
242-
cluster_identity_service_enabled = local.cluster_output_identity_service_enabled
243243
cluster_secret_manager_addon_enabled = local.cluster_output_secret_manager_addon_enabled
244244

245245
# /BETA features

autogen/main/outputs.tf.tmpl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -224,17 +224,17 @@ output "pod_security_policy_enabled" {
224224
value = local.cluster_pod_security_policy_enabled
225225
}
226226

227-
output "identity_service_enabled" {
228-
description = "Whether Identity Service is enabled"
229-
value = local.cluster_identity_service_enabled
230-
}
231-
232227
output "secret_manager_addon_enabled" {
233228
description = "Whether Secret Manager add-on is enabled"
234229
value = local.cluster_secret_manager_addon_enabled
235230
}
236231
{% endif %}
237232

233+
output "identity_service_enabled" {
234+
description = "Whether Identity Service is enabled"
235+
value = local.cluster_identity_service_enabled
236+
}
237+
238238
output "intranode_visibility_enabled" {
239239
description = "Whether intra-node visibility is enabled"
240240
value = local.cluster_intranode_visibility_enabled

autogen/main/variables.tf.tmpl

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -886,18 +886,20 @@ variable "sandbox_enabled" {
886886
default = false
887887
}
888888

889-
variable "enable_identity_service" {
889+
variable "enable_gcfs" {
890890
type = bool
891-
description = "Enable the Identity Service component, which allows customers to use external identity providers with the K8S API."
891+
description = "Enable image streaming on cluster level."
892892
default = false
893893
}
894+
{% endif %}
895+
{% endif %}
894896

895-
variable "enable_gcfs" {
897+
{% if autopilot_cluster != true %}
898+
variable "enable_identity_service" {
896899
type = bool
897-
description = "Enable image streaming on cluster level."
900+
description = "Enable the Identity Service component, which allows customers to use external identity providers with the K8S API."
898901
default = false
899902
}
900-
{% endif %}
901903
{% endif %}
902904
{% if autopilot_cluster %}
903905
variable "allow_net_admin" {

cluster.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,13 @@ resource "google_container_cluster" "primary" {
173173
}
174174
}
175175

176+
dynamic "identity_service_config" {
177+
for_each = var.enable_identity_service ? [var.enable_identity_service] : []
178+
content {
179+
enabled = identity_service_config.value
180+
}
181+
}
182+
176183
enable_kubernetes_alpha = var.enable_kubernetes_alpha
177184
enable_tpu = var.enable_tpu
178185
enable_intranode_visibility = var.enable_intranode_visibility

main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ locals {
123123
cluster_output_horizontal_pod_autoscaling_enabled = coalescelist(lookup(coalescelist(google_container_cluster.primary.addons_config, [{}])[0], "horizontal_pod_autoscaling", [{}]), [{ disabled = false }])[0].disabled
124124
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
125125
cluster_output_intranode_visbility_enabled = google_container_cluster.primary.enable_intranode_visibility
126+
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
126127

127128

128129
master_authorized_networks_config = length(var.master_authorized_networks) == 0 ? [] : [{
@@ -168,6 +169,7 @@ locals {
168169
}]
169170
confidential_node_config = var.enable_confidential_nodes == true ? [{ enabled = true }] : []
170171
cluster_intranode_visibility_enabled = local.cluster_output_intranode_visbility_enabled
172+
cluster_identity_service_enabled = local.cluster_output_identity_service_enabled
171173
cluster_mesh_certificates_config = local.workload_identity_enabled ? [{
172174
enable_certificates = var.enable_mesh_certificates
173175
}] : []

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,11 @@ locals {
9191
cluster_output_horizontal_pod_autoscaling_enabled = coalescelist(lookup(coalescelist(google_container_cluster.primary.addons_config, [{}])[0], "horizontal_pod_autoscaling", [{}]), [{ disabled = false }])[0].disabled
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
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
9495

9596
# BETA features
9697
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
9798
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
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
9999
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
100100

101101
# /BETA features
@@ -130,11 +130,11 @@ locals {
130130
}]
131131
confidential_node_config = var.enable_confidential_nodes == true ? [{ enabled = true }] : []
132132
cluster_intranode_visibility_enabled = local.cluster_output_intranode_visbility_enabled
133+
cluster_identity_service_enabled = local.cluster_output_identity_service_enabled
133134

134135
# BETA features
135136
cluster_istio_enabled = !local.cluster_output_istio_disabled
136137
cluster_pod_security_policy_enabled = local.cluster_output_pod_security_policy_enabled
137-
cluster_identity_service_enabled = local.cluster_output_identity_service_enabled
138138
cluster_secret_manager_addon_enabled = local.cluster_output_secret_manager_addon_enabled
139139

140140
# /BETA features

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -179,16 +179,16 @@ output "pod_security_policy_enabled" {
179179
value = local.cluster_pod_security_policy_enabled
180180
}
181181

182-
output "identity_service_enabled" {
183-
description = "Whether Identity Service is enabled"
184-
value = local.cluster_identity_service_enabled
185-
}
186-
187182
output "secret_manager_addon_enabled" {
188183
description = "Whether Secret Manager add-on is enabled"
189184
value = local.cluster_secret_manager_addon_enabled
190185
}
191186

187+
output "identity_service_enabled" {
188+
description = "Whether Identity Service is enabled"
189+
value = local.cluster_identity_service_enabled
190+
}
191+
192192
output "intranode_visibility_enabled" {
193193
description = "Whether intra-node visibility is enabled"
194194
value = local.cluster_intranode_visibility_enabled

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,7 @@ variable "enable_l4_ilb_subsetting" {
492492
description = "Enable L4 ILB Subsetting on the cluster"
493493
default = false
494494
}
495+
495496
variable "allow_net_admin" {
496497
description = "(Optional) Enable NET_ADMIN for the cluster."
497498
type = bool

0 commit comments

Comments
 (0)