-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
kaniko builds should work with GKE workload identity #3468
Comments
@jlewi Thanks for opening this issue. At this time, we don't have a clear understanding of workload identity. I will look into what (if any) pod config is required for kaniko pod and then follow up here in skaffold. Thanks |
@tejal29 Thanks. If you are using Google Cloud Client libraries to get credentials you shouldn't need to do anything. The client libraries should attempt to contact the metadata server to get credentials if GOOGLE_APPLICATION_CREDENTIALS isn't set. |
This should be relatively easy to implement. |
@balopat - seems reasonable. Alternatively, if we just remove GOOGLE_APPLICATION_CREDENTIALS from kaniko, shouldn't it do the right thing with newer libraries? |
I think you still want And does kaniko use Google Cloud Client libraries to get credentials? |
cc @tejal29 do you know? also, is anyone interested in fixing this one? |
Workload identity also depends on being able to set the K8s service account in order to control the GCP identity that is used. On GKE/GCP it is increasingly common to disallow exporting of service account keys. So this is becoming a blocker. |
Per: GoogleContainerTools/kaniko#968 kaniko works just fine with workload identity. So the issue is just properly configuring the kaniko pod so that WI works. Specifically
|
I just tried using the latest v2beta6 spec (https://skaffold.dev/docs/references/yaml/) It looks like we can set the K8s service account on the pod. To disable GOOGLE_APPLICATION_CREDENTIALS; it looks like we could just add an if statement here skaffold/pkg/skaffold/build/cluster/pod.go Line 132 in 4652950
to not set if pullSecretPath is the empty string.
Likewise I think we could add an if statement to addSecretVolume to not add the secret volume if the secret is the empty string. skaffold/pkg/skaffold/build/cluster/pod.go Line 164 in 4652950
It looks like there might a new code path related to using Tekton
|
Expected behavior
My expectation is that skaffold kaniko builds would work with GKE workload identity
Actual behavior
skaffold kaniko pods end up setting the environment variable
GOOGLE_APPLICATION_CREDENTIALS
.As a result, kaniko pods will not try to use workload identity but instead look for the GCP secret to be provided in the location specified by the secret.
Information
Steps to reproduce the behavior
skaffold <command>
The text was updated successfully, but these errors were encountered: