-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
initial workload identity addition #307
initial workload identity addition #307
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM, just need to:
- Fix CI tests
- Add the new test fixture to the Cloud Build tests
Nevermind, I see where I need to add this. |
And CI is failing because of a different test, not mine, so I'll look at it, but it may be most efficient to review with whoever wrote those tests. |
subnetwork = var.subnetwork | ||
ip_range_pods = var.ip_range_pods | ||
ip_range_services = var.ip_range_services | ||
service_account = "create" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to add identity_namespace = "${module.example-project.project_id}.svc.id.goog"
to have workload identity enabled with //modules/beta-public-cluster/.
Otherwise workload identity fails with Error 400: Identity namespace does not exist (proj-id.svc.id.goog)
cluster_type = "simple-zonal" | ||
} | ||
|
||
provider "google" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need the kubernetes provider also initialized here like:
provider "kubernetes" {
version = "~> 1.10"
host = module.gke.endpoint
cluster_ca_certificate = base64decode(module.gke.ca_certificate)
}
Without this kubernetes provider will try to use the credentials from kubectl.
154e454
to
639319c
Compare
@morgante I'm having trouble finding where the CI tools set which IAM credentials it's using to run tests. I'm running into these errors when running in cloudbuild:
Any advice would be appreciated. |
@milesmatthias I received 403s on my PR yesterday as well. This is due to terraform-google-modules/terraform-google-project-factory#333 |
I may need to bring in some of @bharathkkb's work from #381 to get this working... It seems IAM permissions in this CI test environment are misconfigured for this repo. |
@morgante would love any thoughts you have here to help unblock me. Thanks! |
@milesmatthias Try rebasing on master. The key changes have been merged already. |
Doing those tests here: #391 |
@morgante with updating from master, the integration service account doesn't have the right perms, even though we're giving it SA admin role in
Why is cloudbuild running as |
I think it might be because we authenticate the Kubernetes provider using the CA certificate? Could you try creating a separate Kubernetes provider config specific to the workload identity test? |
@milesmatthias can I help in anyway to push this out? I have been planning to use this submodule in a project |
@bharathkkb Since @milesmatthias isn't working with Google anymore, it might be a good idea for you to take this over and (a) fix merge conflicts + (b) get tests passing. |
@morgante sg, I will do that |
closed via #417 |
No description provided.