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(registry): support AssumeRoleWithWebIdentity for S3 #18686

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

Conversation

davidspek
Copy link
Contributor

@davidspek davidspek commented May 16, 2023

Comprehensive Summary of your change

This PR adds patches to the building of the Harbor registry image that update the AWS SDK and fix how the AWS S3 client is created so that it can use AssumeRoleWithWebIdentity through IRSA.

The upstream PRs used in the patches are distribution/distribution#3921 that change the way the client is created and distribution/distribution#3599 that updates the AWS SDK. I have built the image that results from this PR and verified I can push new images to Harbor while using IRSA. For testing the image davidspek/registry-photon:v2.8.0-irsa-0.1.4 can be used.

Issue being fixed

Fixes #16490 and #12888

Please indicate you've done the following:

  • Well Written Title and Summary of the PR
  • Label the PR as needed. "release-note/new-feature"
  • Accepted the DCO. Commits without the DCO will delay acceptance.
  • Made sure tests are passing and test coverage is added if needed.
  • Considered the docs impact and opened a new docs issue or PR with docs changes if needed in website repository.

@davidspek davidspek requested a review from a team as a code owner May 16, 2023 10:48
@codecov
Copy link

codecov bot commented May 19, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.39%. Comparing base (fb52fdb) to head (2e24e09).
Report is 388 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #18686      +/-   ##
==========================================
- Coverage   67.39%   67.39%   -0.01%     
==========================================
  Files         981      981              
  Lines      107194   107194              
  Branches     2698     2698              
==========================================
- Hits        72246    72241       -5     
- Misses      31065    31069       +4     
- Partials     3883     3884       +1     
Flag Coverage Δ
unittests 67.39% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 8 files with indirect coverage changes

@davidspek
Copy link
Contributor Author

Friendly ping @Vad1mo @wy65701436 @MinerYang

@Vad1mo
Copy link
Member

Vad1mo commented Jun 5, 2023

@davidspek can you demo the setup and configuration in the next community meeting, we can use recording for documentation.

@davidspek
Copy link
Contributor Author

@Vad1mo Sorry for the late response. When is the next community meeting?

@daemon-ian
Copy link

Hi @Vad1mo @wy65701436 @MinerYang - are we clear what the next steps are for getting this merged? It feels like we're really close to getting this long standing issue sorted. Thanks @davidspek for putting this in.

@davidspek
Copy link
Contributor Author

@OrlinVasilev maybe you can also weigh in here.

@OrlinVasilev
Copy link
Member

@wy65701436 can you check please!

@OrlinVasilev
Copy link
Member

@davidspek https://goharbor.io/community/ here is the community page, tomorrow(28th June) we have community meeting here is the calendar link https://lists.cncf.io/g/harbor-users/viewevent?repeatid=51606&eventid=1944638&calstart=2023-06-28 also please add that to the agenda here : https://github.com/goharbor/community/wiki/Harbor-Community-Meetings#june-28-2023

@davidspek
Copy link
Contributor Author

@OrlinVasilev Thanks for the info. I've added the meeting to my calendar and added discussing this PR to the agenda.

@OrlinVasilev
Copy link
Member

@davidspek Thank you :)) see you later :)

Copy link
Contributor

@wy65701436 wy65701436 left a comment

Choose a reason for hiding this comment

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

holding to discuss

@wy65701436
Copy link
Contributor

I'm against this change because we do not want to maintain any forked or modified codebase that deviates from the original one. Instead, we should align with the upstream release cadence and pick up the next release that contains the two PRs. While we currently only have two or three backports that do not have any conflicts, we need to consider the long-term maintenance of our codebase.

Furthermore, the redis patch is critical for users who want to enable redis high availability in sentinel. We only have one patch, which is not likely to conflict with other changes.

@peterellisjones
Copy link

peterellisjones commented Jun 28, 2023

Without this change Harbor is not suitable for most enterprise users using EKS.

  1. Multiple registry replicas are required for harbor to be HA
  2. With multiple replicas, the registry deployment only works with an external blobstore, not filesystem storage. On AWS, this means S3.
  3. Without this PR, Harbor can only authenticate with S3 via static credentials (access key), not IRSA
  4. No enterprise security team wants static S3 credentials floating around when IRSA exists, and they are generally prohibited.

@OrlinVasilev
Copy link
Member

Hi @peterellisjones can you join us later today so we can all discuss that, @wy65701436 can you please also join :)

@mhrabovcin
Copy link

I would be in favour of merging this PR as there is no clear timeline in the upstream registry project when there will be a supported release (v3 or patched v2.x) that can use dynamic AWS credentials.

@OrlinVasilev
Copy link
Member

As discussed yesterday @wy65701436 and @davidspek will join forces to try reaching out to distribution maintainers to merge the fixes so we can have something tested and not customized on our side! you can find the recording here :) https://youtu.be/aMkzKf1vmbQ

Signed-off-by: David van der Spek <vanderspek.david@gmail.com>
Signed-off-by: David van der Spek <vanderspek.david@gmail.com>
@github-actions
Copy link

github-actions bot commented Sep 6, 2023

This PR is being marked stale due to a period of inactivty. If this PR is still relevant, please comment or remove the stale label. Otherwise, this PR will close in 30 days.

@github-actions github-actions bot added the Stale label Sep 6, 2023
@dkulchinsky
Copy link
Contributor

not stale

@github-actions github-actions bot removed the Stale label Sep 7, 2023
Copy link

github-actions bot commented Nov 6, 2023

This PR is being marked stale due to a period of inactivty. If this PR is still relevant, please comment or remove the stale label. Otherwise, this PR will close in 30 days.

@github-actions github-actions bot added the Stale label Nov 6, 2023
@ichasco-heytrade
Copy link

not stale

@github-actions github-actions bot removed the Stale label Nov 7, 2023
@OrlinVasilev
Copy link
Member

@wy65701436 and @davidspek any progress on that?

@peterellisjones
Copy link

peterellisjones commented Nov 22, 2023

Would love to see some progress on this. IMHO without support for assume role Harbor is not really an appropriate product for enterprise users

@OrlinVasilev
Copy link
Member

@peterellisjones absolutely, that's the reason I'm trying to prioritize that :) @msha01 can you put that in the log please!

Copy link

This PR is being marked stale due to a period of inactivty. If this PR is still relevant, please comment or remove the stale label. Otherwise, this PR will close in 30 days.

@github-actions github-actions bot added the Stale label Jan 22, 2024
@Vad1mo Vad1mo added never-stale Do not stale and removed Stale labels Jan 22, 2024
@Vad1mo
Copy link
Member

Vad1mo commented Jan 22, 2024

We should close or update this PR.

Harbor depends on upstream docker distribution, and we are not hard forking docker distribution. We only apply PRs that are in the main branch, but where a release is not published yet.

It looks like that all of the upstream PRs have been closed

The consequence here is A to update this PR or B close this PR.

@Vad1mo Vad1mo removed the never-stale Do not stale label Jan 22, 2024
Copy link

This PR is being marked stale due to a period of inactivty. If this PR is still relevant, please comment or remove the stale label. Otherwise, this PR will close in 30 days.

@github-actions github-actions bot added Stale and removed Stale labels Mar 23, 2024
Copy link

This PR is being marked stale due to a period of inactivty. If this PR is still relevant, please comment or remove the stale label. Otherwise, this PR will close in 30 days.

@github-actions github-actions bot added Stale and removed Stale labels May 23, 2024
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.

Not able to use AWS IAM role in harbor registry with pre-release v2.5.0-rc1 for AWS S3 backend
10 participants