-
Notifications
You must be signed in to change notification settings - Fork 468
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
Only one A record set for headless service with pods having single hostname. #116
Comments
Issues go stale after 90d of inactivity. Prevent issues from auto-closing with an If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or |
This is a real bug that I expect people to hit. :( |
Yep, just ran into this today, while trying to use a headless service to permit direct access to pods in a replicaset. I tried working around it by omitting the hostname from pod definition, but kubedns just ignored the pod all together. For what it's worth, our use case is to provide a mechanism to pass instructions to individual pods within the replicaset (to poll status, instruct it to quiesce, etc) and absent a way to address the pod via dns, we have to hack around the problem (in our case, telling the pod to publish its IP address to our database.) . Looking forward to seeing this resolved. |
Oh my god I need this feature .i am happy to help if someone can give me pointers |
/assign @krmayankk |
i need this feature urgently and would like to help fix it . Who would be the right person to engage with to fix this @thockin |
I believe we verified that this already works in CoreDNS. Check out https://github.com/coredns/deployment/tree/master/kubernetes to see how to deploy it. |
thanks @johnbelamaric could you point to code where this feature got implemented in coredns. We are using 1.9 where coredns is alpha. I would love to move to coredns when this is made seamless to kube-dns |
I don’t think there is specific code to handle this case, it just falls out of how we process the services, endpoints and requests. I think we might have a test for it - @chrisohaver do you know?
|
It's not a special case per se, the code continues to look for all endpoints that match the query name. It doesn't stop when it finds the first match. |
/kind bug
What happened
When a headless service is created to point to pods which share a single hostname, (which happens, for example, when the hostname field was set in the template of a deployment/replicaset)
What was expected to happen
Seems this has to do with the following code:
https://github.com/kubernetes/dns/blob/master/pkg/dns/dns.go#L490
Then the endpointName will be equal for any pod in the service which has the same hostname, so the entry in subCache will be overwritten.
How to reproduce
Apply the following spec:
Resolving the hostnames gives back but a single A record.
PTR records ARE being created for all the pods, all resolving back to the single hostname. This is expected behaviour.
The text was updated successfully, but these errors were encountered: