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

feat(nodeadm): use ecr-credential-provider for public.ecr.aws in 1.27+ #2153

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mselim00
Copy link
Contributor

Issue #, if available:

Description of changes:

Ports 78f54f6 to nodeadm/al2023

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Testing Done

Built a 1.30 AMI, checked the config file had public.ecr.aws in the machImages list and that running a pod using an image from public ECR (public.ecr.aws/nginx/nginx:latest) does not fail when using a role without ecr-public permissions.

See this guide for recommended testing for PRs. Some tests may not apply. Completing tests and providing additional validation steps are not required, but it is recommended and may reduce review time and time to merge.

Comment on lines +1 to +4
{
"apiVersion": "{{.ConfigApiVersion}}",
"kind": "CredentialProviderConfig",
"providers": [
Copy link
Member

@ndbaker1 ndbaker1 Feb 14, 2025

Choose a reason for hiding this comment

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

thoughts on just using the go type for CredentialProviderConfig and serializing it to json?

@@ -74,6 +88,8 @@ func generateImageCredentialProviderConfig(cfg *api.NodeConfig, ecrCredentialPro
} else {
templateVars.ConfigApiVersion = "kubelet.config.k8s.io/v1"
templateVars.ProviderApiVersion = "credentialprovider.kubelet.k8s.io/v1"
// ecr-credential-provider has support for public.ecr.aws in 1.27+
templateVars.MatchImages = append(templateVars.MatchImages, "public.ecr.aws")
Copy link
Member

Choose a reason for hiding this comment

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

ignore me -- I breezed past this part.

Nick's suggestion to use a go type is probably reasonable given how clunky loops are in a go template. Looks like the versions we need are still available in the latest k/k: k8s.io/kubelet/config/v1alpha1, etc

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 this pull request may close these issues.

3 participants