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

Publish ExternalIPs for LoadBalancer services #1500

Merged

Conversation

burningalchemist
Copy link
Contributor

Add feature to publish ExternalIPs for LoadBalancer services.

Use case:

  • Running K8s cluster on Bare-metal behind NAT (1:1)
  • MetalLB implements on-premises LoadBalancer and assigns loadBalancerIP from the given pool (internal network IP).
  • Running Services of type 'LoadBalancer';
  • By adding external IP address we can propagate a DNS entry with publicly available external IP address instead of the internal one.

Currently, ExternalIPs in LoadBalancer services are not processed at all, so there are no breaking changes as far as I can tell.

Note: ExternalIP value is defined separately, so it's out of the scope of ExternalDNS. The only thing needed is to prefer externalIP to loadBalancerIP and let ExternalDNS do the job.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 8, 2020
@k8s-ci-robot
Copy link
Contributor

Welcome @burningalchemist!

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. 😃

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Apr 8, 2020
Copy link
Member

@njuettner njuettner left a comment

Choose a reason for hiding this comment

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

Please make sure you changes include the right formatting, you can run make lint locally to see if there's something not correct.

source/service.go:492: File is not `goimports`-ed (goimports)
source/service_test.go:763: File is not `goimports`-ed (goimports)

@burningalchemist
Copy link
Contributor Author

@njuettner I'm sorry for that. Will fix it shortly, thanks. 👍

@burningalchemist
Copy link
Contributor Author

@njuettner @hjacobs Could you please take a look whenever you have time? :)

@k8s-ci-robot k8s-ci-robot removed the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 4, 2020
@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


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. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label May 4, 2020
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels May 4, 2020
@burningalchemist
Copy link
Contributor Author

burningalchemist commented Jun 2, 2020

@Raffo Could you please take a look at my PR when you have time or suggest someone else? I guess @njuettner is too busy. :)

@jodok
Copy link

jodok commented Jun 24, 2020

would love to see this merged

@burningalchemist
Copy link
Contributor Author

@seanmalloy could you please take a look at this PR? 😃

@seanmalloy
Copy link
Member

@seanmalloy could you please take a look at this PR? 😃

@burningalchemist thanks for reaching out. I'm in the process of ramping on contributing to this project. It will probably take me a few weeks to get to this PR.

CC: @vinny-sabatini

@seanmalloy
Copy link
Member

/kind feature

@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Aug 19, 2020
@burningalchemist
Copy link
Contributor Author

@seanmalloy Thanks for your reply! I'll wait patiently. 👍 Stability wise it's been running smooth without issues since April. 🙂

@seanmalloy
Copy link
Member

@burningalchemist can you please rebase this PR? I'm working on triaging size/M pull requests, so this one on my short list to review now. Thanks!

@burningalchemist
Copy link
Contributor Author

burningalchemist commented Aug 31, 2020

@seanmalloy sure thing, will do shortly. 👍 UPD: Done.

@seanmalloy
Copy link
Member

/assign

Copy link
Contributor

@vinny-sabatini vinny-sabatini left a comment

Choose a reason for hiding this comment

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

LGTM

@seanmalloy
Copy link
Member

@burningalchemist the code changes look good to me. I just have one question.

Do we want to have a configuration option to enable this feature? I think turning the functionality on by default would be considered a braking change, right?

/cc @tariq1890

@burningalchemist
Copy link
Contributor Author

burningalchemist commented Sep 9, 2020

@seanmalloy I haven't yet discovered any cases where ExternalIPs attribute is used with external-dns annotations, and where LoadBalancerIP would be preferred instead to pass to DNS provider.

I'm happy to look into it and for the configuration flag, but I don't see any breaking changes from my side at the moment.

@tariq1890
Copy link
Contributor

@burningalchemist Please add documentation for this. It would be important to mention that External IPs would take precedence over loadBalancer internal IPs

@burningalchemist
Copy link
Contributor Author

@tariq1890 Yes, will do. Thanks!

@seanmalloy
Copy link
Member

@seanmalloy I haven't yet discovered any cases where ExternalIPs attribute is used with external-dns annotations, and where LoadBalancerIP would be preferred instead to pass to DNS provider.

I'm happy to look into it and for the configuration flag, but I don't see any breaking changes from my side at the moment.

Give me some time to think about this and get back to you.

@burningalchemist
Copy link
Contributor Author

@seanmalloy I'm waiting for your feedback, but maybe it's better indeed to cover this behaviour behind a feature toggle, be it publish-external-ip or prefer-external-ip or something else.🙂 I'm up to it, let me know what you think.

@seanmalloy
Copy link
Member

@seanmalloy I'm waiting for your feedback, but maybe it's better indeed to cover this behaviour behind a feature toggle, be it publish-external-ip or prefer-external-ip or something else.🙂 I'm up to it, let me know what you think.

@burningalchemist I discussed with @vinny-sabatini and we are ok not having a feature toggle for this. Please note we are not the official project maintainers for external-dns.

Please add some user documentation for this and I will add my LGTM and then send it for final approval by the project maintainers.

Thanks!

@burningalchemist
Copy link
Contributor Author

@seanmalloy Sounds great, I'll add it shortly. Thanks!

@burningalchemist
Copy link
Contributor Author

@seanmalloy I've added notes to README.md. Seems ok to me. What do you think?

@seanmalloy
Copy link
Member

/lgtm
/assign @Raffo @njuettner

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 16, 2020
@Raffo
Copy link
Contributor

Raffo commented Sep 21, 2020

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: burningalchemist, Raffo

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 k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 21, 2020
@k8s-ci-robot k8s-ci-robot merged commit 3c50299 into kubernetes-sigs:master Sep 21, 2020
@burningalchemist burningalchemist deleted the loadbalancer-externalip branch January 22, 2021 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants