-
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
Allow multiple services to share same dns record #1446
Allow multiple services to share same dns record #1446
Conversation
/assign @hjacobs |
This is also something that we need for our usecase were we need to have a single DNS record on Route53 to send traffic to multiple k8s services which all have the same name but are located in different namespaces. For example
We would like external-dns to be able to create a single serviceA.example.com A record with the IPs of the two serviceA services. So far we are using the multivalue routing option that this does not scale above 8 entries so it's only a workaround. |
/kind feature |
@sagor999 can you please rebase this PR? |
update to latest
@seanmalloy rebased. |
/assign |
@sagor999 I think the code changes you have made look pretty good. The project maintainers will bee do decide if they want to add this feature or not. I am not a maintainer for the k8s external-dns project. Two things that you will need to update if the maintainers/community want to move forward with accepting the feature enhancement.
@Raffo and @njuettner what do you think? Is this a feature you would be willing to accept into the k8s external-dns project? /cc @tariq1890 |
I reached out in Slack to get some feedback from the community to see if people think this feature would be useful or not. https://kubernetes.slack.com/archives/C771MKDKQ/p1599591609100400 |
I sent a message to @Raffo and @njuettner in Slack asking for their feedback: https://kubernetes.slack.com/archives/C771MKDKQ/p1600281812134100 |
Thank you @sagor999 for this PR and @seanmalloy for the great help reviewing PRs. I took some time to try to understand the use case and I have a question: wouldn't a service that points to the other services of the apps be enough to satisfy the use case? I'm thinking of something along the lines of what is described in this stackoverflow thread. I think that if this satisfies your use case, we should avoid adding the feature to ExternalDNS. In general, I find the API of this proposal a bit hard to understand: I struggled to understand what |
@Raffo As for actual implementation: Let me know what you think. |
@sagor999 Before deciding if we want to continue with this PR (in its modified form), I would love to understand if the solution with the additional Service with the |
@Raffo No, that solution not going to fix anything. It will not allow you to share same DNS record with multiple services. |
@sagor999 gotcha. I spent a significant amount of time trying to hack a solution by using an ingress resource without an ingress controller, but ingress is HTTP only and most of the things of the spec are made for such cases. Also, Kubernetes enforces validation on fields that makes the hack hard to implement... too bad cause this could have been a good solution in terms of having an abstraction to represent what you want. I think I've done enough research and attempts to say that what you want to do isn't implementable with Kubernetes as it is today and given that I think that we should proceed with this PR. What I'm asking you to do is to change it with the new |
@Raffo sounds good.
For merging to work, hostname should be the same. So annotation |
@sagor999 yes, sounds good 👍 |
Will this annotation work with multiple instances of external-dns running in different clusters to merge/consolidate DNS records? Basically, does this cover the use case described in Issue #1441? |
@savitha-ping no, my solution will not cover that use case. |
Ahh, that's too bad, I was hopeful :) Can someone provide some input/feedback on #1441? Is it being considered? It is very useful to have in multi-region deployments (i.e. multiple Kubernetes clusters) when using service discovery protocols such as JGroups DNS_PING. |
@Raffo I updated this PR. I added tests to test those cases as well. Let me know what you think and if I missed anything? Or if you have suggestions for improvements. Thank you! |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Raffo, sagor999 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 |
@Raffo : thanx for approving PR, any idea when you will have the next release that includes this PR? |
@sfc-gh-mgarda v0.7.5 is expected to land at the beginning of November. |
This allows multiple services to share same dns record via new annotation:
external-dns.alpha.kubernetes.io/parent
Example:
This allows two separate services to share same dns record and have multiple A records created for same hostname.
This way we still maintain relationship of one dns record = one service.
This is specifically needed for our internal case, where we have to use dns type load balancing and cannot push all traffic through one node.
I do understand if this will get rejected, since this seems like a very specific thing that is needed for our scenario and might not be needed for clusters running in the cloud (ours is bare metal).
Open to suggestions and improvements.