-
Notifications
You must be signed in to change notification settings - Fork 2.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
Optional ability to use the host name defined on an ingress's annotations *instead* of its hosts stanza #1696
Optional ability to use the host name defined on an ingress's annotations *instead* of its hosts stanza #1696
Conversation
@andrecastro and @cryptk FYI on this PR - I was forced to reopen the previous PR with a fresh PR. |
/assign @njuettner for review and feedback on the approaches mentioned in the description. Also, I may need help understanding the code coverage failure. The 17 lines of code I added to ingress.go are covered by a new unit test. But it appears that ingress.go (as a whole) is being reported as having 0 lines covered for some reason, which looks like a general problem with the code coverage job to me. |
/retest |
@Dirrk: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
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. |
/kind feature |
Thanks for this PR @dansimone! I need this :) A use case I have is that I have some Right now (correct me if I'm wrong) I think I would have to update all of my Don't have to make those changes in this PR of course, just expressing my interest in this PR in general, and my particular use case for the current or a future PR. |
All my ingresses define a root domain(example.com) and wildcard domain (*.example.com) in the tls section. Additionally the actual subdomain for the host. External-dns tries always to update all 3 records - I see no other setting to avoid the generation from the tls section. |
…prefer-ingress-annotations
@maxenglander - for your case, to get external-dns to not even look at your ingress at all, you could omit all of the external-dns.alpha.kubernetes.io annotations, like "external-dns.alpha.kubernetes.io/target". I confirmed that just now in my environment (although I am running with quite a few patches on external-dns, so take that with a grain of salt!) This MR here would be for a case where you do want external-dns to act on your ingress, but not to create DNS entries for both the annotation section and the hosts stanza. |
@hjacobs, @njuettner - whenever you guys get a chance to look at this, it's freshly synced with master and passing CI. |
/assign @njuettner |
Thanks for the reply @dansimone. I found that when I have an It's possible there was something else going on or some other misconfiguration I had to produce that result, but it does seem to be expected based on these docs. I'll take another look though. |
It looks like a PR in the same ballpark as this got merged a few days ago: #1645 However that change makes a global setting, and this PR allows the flexibility per-ingress (via a new annotation). I've synced up my branch with master, and both changes should play nice together. |
This feature is exactly what we need. |
@hjacobs, @njuettner please let me know when you get a chance to look at this. |
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.
LGTM, some minor nits. If addressed I'm happy to merge it 👍
…prefer-ingress-annotations
…n the hostname source annotation
Thanks for the feedback, @njuettner. Let me know how the latest looks to you. |
I just resolved the above conversations, @njuettner, let me know if this looks alright. |
@dansimone thanks for implementing it. Would this feature allow ignoring certain Kubernetes resources? |
Sounds like you might want an annotation filter there, which has been available and is pretty common to use. I use an annotation filter that overlaps with the ingressclass annotation but you can filter on whatever custom annotation you want |
…prefer-ingress-annotations # Conflicts: # docs/faq.md
Ok, a new (minor doc) conflict just popped up. Resolved. @njuettner, please review. |
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.
I've tested this out and it works well.
Can we merge this, please? |
@njuettner I just went ahead and closed this comment: #1696 (comment) But I'm looking for input on the pros and cons that I pointed out above, although I went with your suggestion for now. |
Is there any expected inclusion date for this feature? |
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dansimone, jlamillan, njuettner 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 |
in which version this is going to be released? |
There are situations where it would be useful to have external-dns create entries based on the "external-dns.alpha.kubernetes.io/hostname" annotation on an ingress, but not on the hosts defined in the hosts stanza. The current external-dns behavior is to create both entries.
Some examples where this would be useful:
Possible approaches to implement this behavior:
This current PR goes with approach 2 (originally proposed by @cryptk) - IMO that is the smallest footprint way of implementing this. 1 and 3 involve a new command line parameter, some function argument changes, etc. It's easily doable though, if desired. I'll defer to feedback from the maintainers on whether to go with 1 or 3.
The current PR adds the annotation described by this included update to the FAQ:
Unit tests added to verify the behavior.