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

host-ctr: use user-provided reg creds for 'public.ecr.aws' #2676

Merged
merged 1 commit into from
Jan 4, 2023

Conversation

etungsten
Copy link
Contributor

@etungsten etungsten commented Dec 20, 2022

Issue number:
Resolves #2671

Description of changes:

    host-ctr: use user-provided reg creds for 'public.ecr.aws'
    
    If users provide their own registry credential for 'public.ecr.aws' then
    use that credential instead of the fetched credentials from ECR public.

Testing done:

Validated by @ahreehong and @vignesh-goutham.

To summarize:
On vmware-k8s-1.23, specified a private registry mirror for public.ecr.aws and specified registry creds for the registry mirror.

[settings.container-registry.mirrors]
"public.ecr.aws" = ["https://198.18.34.118:443"]
[settings.pki.registry-mirror-ca]
data = "<redacted>"
trusted=true
[[settings.container-registry.credentials]]
registry = "public.ecr.aws"
username = "<redacted>"
password = "<redacted>"

host-ctr is able to pull images from the registry mirror at 198.18.34.118 and start host containers and bootstrap containers.

There is a separate issue we discovered as part of this validation. cri-containerd requires the registry creds to be set for the registry mirror itself (198.18.34.118) and not the destination registry host (public.ecr.aws in this case). There needs to be a follow-up fix to align host-ctr's way of constructing the image resolver with cri-containerd's. See #2677 for more info.

This PR is still valid on it's own regardless; Users might still want to be able to get public ECR creds themselves and pass it manually through settings.container-registry.credentials for public.ecr.aws.

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

@etungsten etungsten changed the title host-ctr: use user provided reg creds for 'public.ecr.aws' host-ctr: use user-provided reg creds for 'public.ecr.aws' Dec 20, 2022
Copy link
Contributor

@stmcginnis stmcginnis left a comment

Choose a reason for hiding this comment

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

Looks good!

Copy link
Contributor

@jpmcb jpmcb left a comment

Choose a reason for hiding this comment

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

Beautiful! 👏🏼

If users provide their own registry credential for 'public.ecr.aws' then
use that credential instead of the fetched credentials from ECR public.
@etungsten etungsten merged commit 2811232 into bottlerocket-os:develop Jan 4, 2023
@etungsten etungsten deleted the public-ecr-reg-creds branch January 4, 2023 19:40
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.

host-ctr: setting img reg credentials for public.ecr.aws does not work
5 participants