-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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(aws): multiple zone roles #5057
base: master
Are you sure you want to change the base?
feat(aws): multiple zone roles #5057
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
Welcome @hjoshi123! |
Hi @hjoshi123. 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. |
Hey. It will not fixes the issue, but it relates. As the issue is more about HOW to, and not WHY something is not supported. The problem should be clear enough, so that the maintainers will decide where or not it worth to be added to master (disclaimer, I'm not one of them) You may need to start or look at documentation. As not clear how and what this pull request is solving. It's more like a new feature. So worth to explain you case and setup. As well as share how this was tested, specifically need to make sure this not break current functionality and what is wrong with current flags like |
For more context @ivankatliarchuk I am trying to solve the problem where one external dns instance can manage multiple aws hosted zones through role assumption. So ideally we wouldn't need multiple instances or an umbrella chart if my proposal is accepted. My change currently uses the map:
Once the map is ready then the configured profile through the aws profile or the default profile is used to assume roles for different domains and then whenever the change matches to the hosted zone those creds are used. @szuecs or @mloiseleur do you guys feel this is within the scope? If yes I could start adding unit tests and make the PR cleaner |
Worth adding to the header of the pull request a description |
@@ -347,7 +347,7 @@ func TestAWSZones(t *testing.T) { | |||
func TestAWSZonesWithTagFilterError(t *testing.T) { | |||
client := NewRoute53APIStub(t) | |||
provider := &AWSProvider{ | |||
clients: map[string]Route53API{defaultAWSProfile: client}, | |||
clients: map[string][]*AWSZoneConfig{defaultAWSProfile: {{Route53Config: client}}}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm that reads not obvious enough to me for being a "clients".
type AWSZoneConfig struct { | ||
Config awsv2.Config | ||
HostedZoneName string | ||
Route53Config Route53API |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On my phone so no lookup possible, so maybe I am wrong.
The name seems to be wrong. I think elsewhere we call it client iirc.
Not sure what this statement even means. In the issue itself I have described a way, as all the AWS IAM roles should be least privilege, all the external-dns deployments are isolated and deployed to a required location. Umbrella chart was given as an example tool that could be used, but not required. So it's not a disadvantage, it's one of the options how to manage multiple AWS accounts and zones in a secure way. Initial issue #4526 is about HOW to setup, as there are missing documentation, not missing capabilities. At the moment And issue #4526 is about multiple accounts not multiple Domains to be managed by different IAM roles. I would love to see a tutorial, currently not too clear how this will work when there are 100+ zones in account and let's say are a dozen of AWS accounts. |
@ivankatliarchuk this solution handles the problem of multiple accounts. It allows you mention the roles you want to use for the hosted zone/domain you want. It could be delegated domains in different accounts or diff domains altogether. As long as the profile you mention has permission to assume the role(s), this solution can manage it. As @szuecs also pointed during my discussion with him in slack, I would also add documentation around this and that if there are multiple roles within the same account then there could be rate limit issues. |
Just few concerns
|
@ivankatliarchuk to address some of your concerns:
|
…aws-multiple-zones-roles
/retitle feat(aws): multiple zone roles |
@hjoshi123 Would you please update documentation accordingly to show how it can be used ? /ok-to-test |
@mloiseleur should I also edit the helm chart to add the option to the schema and values file as part of the PR? |
High level though and observations that needs to be addressed
I'm not sure how is all set. But what stopping an engineer, let's say when there are accounts A,B,C,D,E to simply configure an IAM roles and trusts for account X where I may misunderstood something, same time releasing as is, sounds quite risky option. |
@ivankatliarchuk Clarifying some points as you told:
This is not possible as that would be role chaining.. let's say the primary external dns has a pod identity, it can now assume only one role which can have access to a particular account. We can't give the pod identity access to multiple accounts because AWS doesn't allow that. This option would be good if AWS allowed it. |
…aws-multiple-zones-roles
This pull request is a bit controversial to me. There is no matching issue, linked issue is asking for HOW to do it. On aws, I could create a role A, attach to external DNS and create roles B,C,D,E,.... in other accounts and configure a trust to role A. Hence external-dns could have access to all route53 endpoints in account B,C,D,E without code changes in current codebase. More important, we not following the model for other k8s-sigs products, where single instance-single account. I could be wrong here, but not found other examples. |
@ivankatliarchuk I am not sure if the approach you were mentioning works. Let's say external dns has credentials through pod identity or IRSA it can be told to assume only one role. That role can only have access to route53 of that account. Role chaining is not possible with the current setup. About the second point, I am not sure. I would defer it to you guys to decide @ivankatliarchuk @szuecs @mloiseleur. I do know in external secrets you can deploy multiple secret stores in a declarative way with different roles on a single deployment without using umbrella charts. |
Description
For more context I am trying to solve the problem where one external dns instance can manage multiple aws hosted zones through role assumption. So ideally we wouldn't need multiple instances or an umbrella chart if my proposal is accepted.
As far the --aws-profile= that would still be valid since external dns would need a profile to have permissions to do the sts:AssumeRole. For backwards compatibility, we could still keep the --aws-assume-role= too although my current change would create a breaking change for it.
My change currently uses the map:
aws-domain-roles=zzz.com=aws:arn...
Once the map is ready then the configured profile through the aws profile or the default profile is used to assume roles for different domains and then whenever the change matches to the hosted zone those creds are used.
Fixes #4526
Checklist