-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
TargetGroupBindings can now manipulate target groups from different aws accounts #3691
base: main
Are you sure you want to change the base?
Conversation
Hi @marcosdiez. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: marcosdiez The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@shraddhabang I believe my code is ready. Feel free to review at will! Thank you. Also, if you don't want the CRDs to be changed, here: they are untouched. |
Thank you @marcosdiez for this PR. This looks excellent. |
/ok-to-test |
70267e1
to
bb3c617
Compare
7b5b35f
to
85bbf7f
Compare
Hi @shraddhabang ,
Could you please share us when the v2.9.0 would release? We are looking forward to this feature. |
Hi, @johngmyers @M00nF1sh @shraddhabang
Does anyone know the release schedule for v2.9.0 ? |
85bbf7f
to
6025b73
Compare
I just rebased and merged my code. There is also a container available here: |
6025b73
to
76593a9
Compare
Small update: the old docker container was broken. Please use |
76593a9
to
5011686
Compare
/retest |
Hey @marcosdiez, 10x for the great work i tried your image (marcosdiez/aws-load-balancer-controller:v2.8.3-m2) and it works great :) FYI, at first i didn't provided the necessary permissions and the pod crashed, with a good error message :) waiting for a Merge to main :) |
5011686
to
7add3d2
Compare
@shraddhabang any plans on merging this ? It took me 8 hours for this last rebase.... |
@shraddhabang appreciate if you can speed up this merge/release. There's significant work done on it now. |
Awesome! Please merge it ASAP🙏🏻 |
d88997a
to
c27a354
Compare
This is great!! |
PR needs rebase. 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. |
Issue #3634
Description
Now, every time a
TargetGroupBinding
has thealb.ingress.kubernetes.io/IamRoleArnToAssume
(and optionallyalb.ingress.kubernetes.io/AssumeRoleExternalId
) annotations, we assume it before interacting to it (actually, the assume role operation is cached).In real life, I changed:
RegisterTargets
/DeregisterTargets
/ListTargets
This way we can easily manipulate target groups from target group bindings for every single AWS account in the world, as long as there is a role we can assume. In order to prevent the confused deputy problem,
external id
is supported.The way this was implemented was actually way simpler than initially imagined:
the
service.elbv2Client
object now supports a new method calledAssumeRole
which returnsservice.elbv2Client
on the specified role. The catch is that ifAssumeRole
is called with a blank role, the object returns itself and life goes on.In other words, every time we call some method from
elbv2Client
from something related to target groups, we also callAssumeRole
and that's basically it.Caching the assumed role was also trivial, a simple map that is stored on
cloud.go
I decided to have
cloud.go
manage the caching becuase in the future it could assume role for other objects if needed and all the assume role logic would be in the same place.The only unfortunate change that needed to be made is that
aws.Cloud
becameservices.Cloud
else golang would complain about circular dependency :(This is what the logs look like:
Documentation and tests were properly updated in this PR
Checklist
README.md
, or thedocs
directory)BONUS POINTS checklist: complete for good vibes and maybe prizes?! 🤯
A working amd64 container with this code is available here:
marcosdiez/aws-load-balancer-controller:v2.7.2-m2
update: on 2024-09-26 I rebased the code. The new container image is
marcosdiez/aws-load-balancer-controller:v2.8.3-m2
update: on 2024-10-28 I rebased the code again :(. The new container image is
marcosdiez/aws-load-balancer-controller:v2.9.0-m1