Skip to content

Conversation

@fletcherw
Copy link
Contributor

/kind bug

What this PR does / why we need it:
When ecr-credential-provider is configured to use ServiceAccountTokens for fetching ECR credentials, it should allow ignoring those credentials if the service account doesn't have the corresponding annotations.

Update the provider to try to use a ServiceAccountToken and fall back to standard local credentials otherwise.


Kind of related to #1264.

When ecr-credential-provider is configured to use ServiceAccountTokens
for fetching ECR credentials, it should allow ignoring those credentials
if the service account doesn't have the corresponding annotations.

Update the provider to try to use a ServiceAccountToken and fall back to
standard local credentials otherwise.
@k8s-ci-robot
Copy link
Contributor

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Oct 17, 2025
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If cloud-provider-aws contributors determine this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign yue9944882 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Oct 17, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @fletcherw. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 17, 2025
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So far as I know, you can only assign 1 IAM role to a pod through IRSA. However, it's unclear whether SA token authentication requires IRSA. If the ecr-role-arn and role-arn have to be the same, then we should update this PR to only use role-arn as that is key that IRSA uses.

Copy link
Contributor Author

@fletcherw fletcherw Oct 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little new to this but this is my understanding

Each pod has exactly one service account associated with it. By default, if you annotate that service account with eks.amazonaws.com/role-arn, the pod identity agent webhook will get a service account token for that node account, assume that role and pass those credentials into the pod's containers.

Separately, before a pod is created, if there is a CredentialProvider that has matchImages matching the image URL and that configures tokenAttributes, the kubelet will also create a Service Account token and pass that to the credential provider.

I don't see why the IAM role that the credential provider assumes would have to match the role that the pod identity webhook assumes, though I'm sure that for many people they will be the same.

@jicowan
Copy link

jicowan commented Oct 21, 2025 via email

@fletcherw
Copy link
Contributor Author

What credential provider config were you using in that situation? If you had specified "requiredServiceAccountAnnotationKeys": ["eks.amazonaws.com/ecr-role-arn", "eks.amazonaws.com/role-arn"] it makes sense it would require both, but with optionalServiceAccountAnnotationKeys instead I think just one would be fine.

@jicowan
Copy link

jicowan commented Oct 22, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. kind/bug Categorizes issue or PR as related to a bug. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants