Skip to content

Support ServiceAccountToken in ecr-credential-provider#1155

Merged
k8s-ci-robot merged 8 commits into
kubernetes:masterfrom
fletcherw:fletcherw/session_token
Jun 6, 2025
Merged

Support ServiceAccountToken in ecr-credential-provider#1155
k8s-ci-robot merged 8 commits into
kubernetes:masterfrom
fletcherw:fletcherw/session_token

Conversation

@fletcherw
Copy link
Copy Markdown
Contributor

Extend ecr-credential-provider to support fine-grained access via kubernetes ServiceAccount tokens and STS's AssumeRoleWithWebIdentity.

This allows users to avoid long-lived secrets in their pods/nodes and instead use a short-lived credential generated by kubernetes in order to access private ECR images.

What type of PR is this?
/kind feature

What this PR does / why we need it: This PR

Which issue(s) this PR fixes:

Fixes #1147

Does this PR introduce a user-facing change?:


This PR adds support for using ServiceAccount tokens to authenticate with AWS when pulling images from private ECR registries. (See https://github.com/kubernetes/enhancements/issues/4412)
Users who wish to use this new feature will need to opt in to the feature flag and configure their kubernetes cluster and AWS resources appropriately.

Extend ecr-credential-provider to support fine-grained access via
kubernetes ServiceAccount tokens and STS's AssumeRoleWithWebIdentity.

This allows users to avoid long-lived secrets in their pods/nodes and
instead use a short-lived credential generated by kubernetes in order to
access private ECR images.
@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. labels Jun 2, 2025
@k8s-ci-robot k8s-ci-robot requested review from kishorj and mmerkes June 2, 2025 23:02
@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented Jun 2, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Jun 2, 2025
@k8s-ci-robot
Copy link
Copy Markdown
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.

Details

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 cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Jun 2, 2025
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Welcome @fletcherw!

It looks like this is your first PR to kubernetes/cloud-provider-aws 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/cloud-provider-aws has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot
Copy link
Copy Markdown
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.

Details

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 needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Jun 2, 2025
@cartermckinnon
Copy link
Copy Markdown
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 3, 2025
@fletcherw fletcherw changed the title [WIP] Support ServiceAccountToken in ecr-credential-provider Support ServiceAccountToken in ecr-credential-provider Jun 4, 2025
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 4, 2025
@fletcherw
Copy link
Copy Markdown
Contributor Author

/assign cartermckinnon

Comment thread cmd/ecr-credential-provider/main.go Outdated
Comment thread cmd/ecr-credential-provider/main.go Outdated
Comment thread cmd/ecr-credential-provider/main.go Outdated
Comment thread cmd/ecr-credential-provider/main.go
Comment thread tests/e2e/ecr_creds.go Outdated
Comment thread cmd/ecr-credential-provider/main.go
@cartermckinnon
Copy link
Copy Markdown
Contributor

This is great, thanks @fletcherw!

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 6, 2025
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cartermckinnon

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

The pull request process is described here

Details 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 approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 6, 2025
@k8s-ci-robot k8s-ci-robot merged commit 1137413 into kubernetes:master Jun 6, 2025
11 checks passed
@fletcherw fletcherw deleted the fletcherw/session_token branch June 6, 2025 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for service account token in ece-credential-provider

3 participants