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

Add support to add labels to in cluster builds to skaffold.yaml #9549

Open
LatexGolem opened this issue Oct 18, 2024 · 0 comments · May be fixed by #9553
Open

Add support to add labels to in cluster builds to skaffold.yaml #9549

LatexGolem opened this issue Oct 18, 2024 · 0 comments · May be fixed by #9553

Comments

@LatexGolem
Copy link

Expected behavior

I'd like to use Azure AD Workload Identity to authenticate my kaniko in-cluster build pod to my Azure container registry, rather than use hard coded service provider credentials in the skaffold.yaml which will be checked in VCS.

In order for workload identity to work, the kaniko pod needs the below label present per the reference here
azure.workload.identity/use: "true"

It is odd that MS have opted to use a Label rather than an Annotation for this behaviour.

While we can set annotations via build.cluster:annotations, it would be nice if we could achieve the above with a build.cluster.labels or build.artifacts:kaniko.labels.

Actual behavior

As the environmental variables are not injected because the label is absent, the build fails to authenticate with the ACR

DEBU[0000] Getting source context from dir:///kaniko/buildcontext
DEBU[0000] Build context located at /kaniko/buildcontext
DEBU[0000] Copying file /kaniko/buildcontext/Dockerfile to /kaniko/Dockerfile
error checking push permissions -- make sure you entered the correct tag name, and that you are authenticated correctly, and try again: checking push permission for "acrname.azurecr.io/testimg:latest": POST https://acrname.azurecr.io/v2/testimg/blobs/uploads/: UNAUTHORIZED: authentication required, visit https://aka.ms/acr/authorization for more information.; [map[Action:pull Name:testimg Type:repository] map[Action:push Name:testimg Type:repository]]
build [acrname.azurecr.io/testimg] failed: pod has failed

If I manually insert credentials via build.artifacts.kaniko.env, it authenticates as expected. However I don't want these credentials sitting in plain text checked into VCS for obvious reasons.

@idsulik idsulik linked a pull request Oct 25, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants
@LatexGolem and others