Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added option for external identity providers #1917

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions modules/private-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,8 @@ Then perform the following commands on the root folder:
| upstream\_nameservers | If specified, the values replace the nameservers taken by default from the node’s /etc/resolv.conf | `list(string)` | `[]` | no |
| windows\_node\_pools | List of maps containing Windows node pools | `list(map(string))` | `[]` | no |
| zones | The zones to host the cluster in (optional if regional cluster / required if zonal) | `list(string)` | `[]` | no |
| enable_identity_service | Enable external identity providers to authenticate to GKE | `bool` | `false` | no |


## Outputs

Expand Down
6 changes: 6 additions & 0 deletions modules/private-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,12 @@ resource "google_container_cluster" "primary" {
}
}

dynamic "identity_service_config" {
for_each = var.enable_identity_service ? [var.enable_identity_service] : []
content {
enabled = identity_service_config.value
}
}
master_auth {
client_certificate_config {
issue_client_certificate = var.issue_client_certificate
Expand Down
5 changes: 5 additions & 0 deletions modules/private-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -727,3 +727,8 @@ variable "fleet_project" {
type = string
default = null
}
variable "enable_identity_service" {
type = bool
description = "Enable the Identity Service component, which allows customers to use external identity providers with the K8S API."
default = false
}
2 changes: 1 addition & 1 deletion modules/private-cluster/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
version = ">= 5.9.0, < 6"
version = ">= 5.21.0, < 6"
}
kubernetes = {
source = "hashicorp/kubernetes"
Expand Down
Loading