external-dns icon indicating copy to clipboard operation
external-dns copied to clipboard

feat(aws): use AWS profiles using .credentials file

Open roehrijn opened this issue 2 years ago • 16 comments
trafficstars

Description

This PR introduces a new command line flag --aws-profile which can be used multiple times and allows to make use of AWS profiles in .credentials files (see also Configuration and credential file settings). Furthermore the PR allows to use multiple of these profiles at once in a way that it queries for available Route53 zones using credentials of each profile and later distinguishes between the profiles in order to make changes with proper credentials to the right Route53 zone.

We at Mercedes-Benz are running a fork with those changes now for several months in production.

Checklist

  • [x] Unit tests updated
  • [x] End user documentation updated

Jan Roehrich [email protected], Mercedes-Benz Tech Innovation GmbH, legal info/Impressum

roehrijn avatar Oct 05 '23 11:10 roehrijn

Welcome @roehrijn!

It looks like this is your first PR to kubernetes-sigs/external-dns 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/external-dns has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. :smiley:

k8s-ci-robot avatar Oct 05 '23 11:10 k8s-ci-robot

Hi @roehrijn. 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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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/test-infra repository.

k8s-ci-robot avatar Oct 05 '23 11:10 k8s-ci-robot

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please assign johngmyers for approval. For more information see the Kubernetes Code Review Process.

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 /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

k8s-ci-robot avatar Oct 05 '23 11:10 k8s-ci-robot

/ok-to-test

tobiasgiese avatar Oct 05 '23 14:10 tobiasgiese

What is the value of having this complexity versus running an external-dns deployment per profile?

johngmyers avatar Oct 08 '23 23:10 johngmyers

/retest

johngmyers avatar Oct 08 '23 23:10 johngmyers

Hi @johngmyers, we run almost 1000 Kubernetes clusters which are concurrently accessing our Route53 zones through external-dns. To cope with Route53 throttling we need to distribute our zones over several AWS accounts which leads us to 6 profiles, currently. During some migration situations there might even be 9 profiles. Thus, the answer to your question about value has two dimensions. First, we have the complexity of running and managing up to 9 external-dns instances on up to 1000 clusters. On the other hand it is also about resource consumption. In the setup we use we need to request at least 60MB of memory per instance in order to work properly, in some situations a bit more. 60MB * 6 instances * 1000 clusters = a lot of additional EC2 costs.

roehrijn avatar Oct 13 '23 06:10 roehrijn

AWS profile is a feature of aws config file used in many aws compatible tools. Do you think you can rebase and finish this PR ?

mloiseleur avatar Oct 31 '23 13:10 mloiseleur

Hi @mloiseleur, yes I'm going to rebase soon. Just had some other important topics on the table over the last view weeks.

roehrijn avatar Nov 13 '23 09:11 roehrijn

Hi @mloiseleur, I rebased the PR. Do you see a chance to get this aspect merged? If yes, I would also take the effort to adapt the documentation accordingly.

roehrijn avatar Nov 14 '23 09:11 roehrijn

@roehrijn As soon as you finish and rebase this PR, I don't see why not ?

Note: It surely could help too to remove the WIP in the title.

mloiseleur avatar Dec 23 '23 17:12 mloiseleur

I have minor suggestion, and I think we are good to go.

mloiseleur avatar Jan 03 '24 09:01 mloiseleur

@mloiseleur Thanks a lot for the quick response. Minor nits are fixed.

roehrijn avatar Jan 03 '24 10:01 roehrijn

@mloiseleur @szuecs, please let me know if there is something left to do in order to get this merged. I would be very happy to avoid further rebases if possible, because it is a lot of work to validate function and valid documentation after each rebase. I'm eager to deal with missing aspects, however it would kindly ask to get to know them all together in order to avoid extra work.

roehrijn avatar Mar 06 '24 11:03 roehrijn

I understand. I think we are at the end. /lgtm /assign @szuecs for final review

mloiseleur avatar Mar 12 '24 16:03 mloiseleur

/retitle feat(aws): use AWS profiles using .credentials file

mloiseleur avatar Mar 12 '24 16:03 mloiseleur

/approve

szuecs avatar Jun 10 '24 19:06 szuecs

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: szuecs

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

k8s-ci-robot avatar Jun 10 '24 19:06 k8s-ci-robot

/lgtm

mloiseleur avatar Jun 10 '24 20:06 mloiseleur