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

[BUG] Service account created doesn't have the correct name #1609

Closed
griseau opened this issue Apr 17, 2023 · 0 comments · Fixed by #1610
Closed

[BUG] Service account created doesn't have the correct name #1609

griseau opened this issue Apr 17, 2023 · 0 comments · Fixed by #1610
Labels
bug Something isn't working

Comments

@griseau
Copy link
Contributor

griseau commented Apr 17, 2023

TL;DR

When specifying a service_account_name, with create_service_account = True the created service account doesn't have the correct name, and the node pool is waiting for the service_account_name that you provided. This results in the inability to set a service_account_name.

Expected behavior

When specifying a service_account_name, the created service_account has the correct name, and is the one used by the node pool

Observed behavior

Node pool is using correct service_account_name, but the service account created is not the correct one.

Terraform Configuration

module "gke" {
  source  = "terraform-google-modules/kubernetes-engine/google//modules/private-cluster"
  version = "25.0.0"
  depends_on = [
    google_project_iam_member.roles
  ]
  name                       = var.cluster_name
  project_id                 = var.project_id
  network                    = var.cluster_network
  subnetwork                 = var.cluster_subnetwork
  ip_range_pods              = var.cluster_ip_range_pods
  ip_range_services          = var.cluster_ip_range_services
  network_project_id         = var.cluster_network_project_id
  region                     = var.default_region
  remove_default_node_pool   = true
  enable_private_nodes       = true
  enable_private_endpoint    = true
  master_ipv4_cidr_block     = "172.16.255.240/28"
  master_authorized_networks = [{ cidr_block = "172.16.255.240/28", display_name = "placeholder to not have a public IP" }]
  service_account            = "gke-${var.cluster_name}@${var.project_id}.iam.gserviceaccount.com"
}

Terraform Version

Terraform v1.4.0

Additional information

Service account name defined here is not using the correct name : https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/blob/master/sa.tf#L42

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant