Skip to content

Commit

Permalink
Rervert the jupyter hub sa change to fix the cluster creation fail
Browse files Browse the repository at this point in the history
Tested-by: zlq
  • Loading branch information
blackzlq committed Mar 11, 2024
1 parent 339aba2 commit 64b6c07
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions modules/jupyter/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,26 @@ resource "kubernetes_annotations" "hub" {
]
}

data "google_service_account" "sa" {
account_id = var.workload_identity_service_account
depends_on = [
helm_release.jupyterhub,
module.jupyterhub-workload-identity
]
}

resource "google_service_account_iam_binding" "hub-workload-identity-user" {
count = var.add_auth ? 1 : 0
service_account_id = module.jupyterhub-workload-identity.gcp_service_account
service_account_id = data.google_service_account.sa.name
role = "roles/iam.workloadIdentityUser"

members = [
"serviceAccount:${var.project_id}.svc.id.goog[${var.namespace}/hub]",
"serviceAccount:${var.project_id}.svc.id.goog[${var.namespace}/${var.workload_identity_service_account}]",
]
depends_on = [
helm_release.jupyterhub
helm_release.jupyterhub,
module.jupyterhub-workload-identity
]
}

Expand Down

0 comments on commit 64b6c07

Please sign in to comment.