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

Support for S3 Buckets in Different Accounts? #129

Closed
EdKingscote opened this issue Jan 20, 2024 · 6 comments
Closed

Support for S3 Buckets in Different Accounts? #129

EdKingscote opened this issue Jan 20, 2024 · 6 comments
Labels
enhancement New feature or request

Comments

@EdKingscote
Copy link

/feature

I'm looking at running this in a self-hosted K8s environment but desire to access different S3 buckets that are spread across multiple AWS accounts, which means each will need a unique access/secret key combination.

I've spent a fair bit of time looking around, but it isn't clear to me whether this is achievable. The only thing I can envisage right now is using mountOptions on the Persistent Volume definition to be able to select the right credential profile, but I can't see a way to provide the profiles needed.

Many thanks

@jjkr
Copy link
Contributor

jjkr commented Jan 23, 2024

Thank you for the request. You’re correct that the current authentication mechanisms are generally designed to share a single IAM role across multiple mounts on a node. The driver will pass the profile option on to the mountpoint process, so adding a line like - profile=myprofile to the persistent volume configuration is a potential workaround. To make this work, you will need a credentials file in /root/.aws in the host’s filesystem (not a container because the actual FUSE process runs outside of the driver in the host’s systemd). See the Mountpoint documentation for more details on how their authentication works.

We will keep this request open as a feature to make multiple account access possible or at least easier and share any updates as we have them.

@jjkr jjkr added the enhancement New feature or request label Jan 25, 2024
@masterkain
Copy link

I have the same need

@herrLierb
Copy link

I also would like to point out, that it would be very nice to not use the same IAM role to access all s3 buckets, but to be able to specify exactly which role to be used on a per bucket basis - en par with the featureset of the efs driver regarding authentication.

@ha7315
Copy link

ha7315 commented Oct 6, 2024

Cross-account S3 bucket access is working for me. I used a pod with an IRSA service account, then trusted that IAM principle in the bucket policy.

@muddyfish
Copy link
Contributor

@EdKingscote we released CSI Driver v1.9.0, which adds support for pod level authentication sources with IRSA. IRSA supports cross-account access. Can you check that this works as you'd expect?

@unexge
Copy link
Contributor

unexge commented Oct 24, 2024

Mountpoint CSI Driver v1.9.0 added support for Pod-level identity. Using this feature you can configure cross-account S3 Bucket access at Pod granularity. We documented cross-account access using both bucket policies and IRSA. See Cross-account bucket access for more details.

Closing this issue, please let us know if your use-case isn't covered with the mentioned approaches.

@unexge unexge closed this as completed Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

7 participants