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
Custom DNS entries for kube-dns #55
Comments
Answering @bowei:
It's not the case, they are in their own domain. With name clash you refer to something like the possibility of sinkholing "google.com" for your cluster? Or unintended clashes?
This is my specific use case:
What I ended up doing is deploying dnsmasq in one of the nodes, and add it's address to /etc/resolv.conf to the master node, so that kube-dns picks it up as upstream server. However, IMHO this has two disadvantages compared to the feature I described:
In my mind, this feature is intended for testing environments, just like a "cluster-wide /etc/hosts". As there are several workarounds, maybe the use case is not so common and doesn't justify the effort. |
Does externalName work for your use case https://kubernetes.io/docs/user-guide/services/#without-selectors ? |
Are you trying to get real IPs for *.cluster.int.domain.corp or are you
trying to provide fake answers?
If we had what Bowei describes, you could deploy a micro-DNS-server that
answered cluster.int.domain.corp for a known set of IPs, or send queries to
the real DNS server for that domain.
If what you want is to fake some DNS replies, it is more complicated...
…On Tue, Feb 14, 2017 at 9:36 AM, cmluciano ***@***.***> wrote:
Does externalName work for your use case https://kubernetes.io/docs/
user-guide/services/#without-selectors ?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#55 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AFVgVGRlWw0zY-4QMVycfPrEtI_-A2_Mks5rceYmgaJpZM4MAN2O>
.
|
Sorry for my late reply. @cmluciano: externalName does not work because the containers need to resolve the name, and they can't reach our internal DNS. @thockin: the stub DNS server is what I ended up implementing. However, I still think there is a valid use case for having quick custom DNS profiles. Feel free to close the issue if you think the feature is not interesting. |
I'm all for extending KubeDNS's api so you can do CRUD on dns records yourself or by adding the service aliases as mentioned in kubernetes/kubernetes#39792, because that's what I'm really after. |
We met the same case as morallo mentioned above and hope kube-dns can both support k8s service and custom dns rule. |
You can do this with CoreDNS: http://coredns.io |
FYI, just put out a blog that shows how to do it. https://blog.coredns.io/2017/05/08/custom-dns-entries-for-kubernetes/ |
You can also use the built-in mechanism with 1.6: http://blog.kubernetes.io/2017/04/configuring-private-dns-zones-upstream-nameservers-kubernetes.html |
To make an external service resolvable in the cluster, You can manually create a Service and a Endpoint that point to an external IPv4 and it would be resolvable w/ the correct namespace and cluster domain. (I use it for GlusterFS). |
We have a similar issue with Couchbase. If we deploy a All we need is KubeDNS to use a constant entry for PODs fronted by ClusterIP services. If it wants to use The situation as of now of completely hopeless. I simply can’t get Couchbase working in Kubernetes. |
That seems like an issue with the Couchbase client, does it not discover all the endpoints of the database and retry connecting to another IP? If not, then you can just create another service pointing to the same deployment. For example, have a You can also use a StatefulSet so that pods are always numbered in order and will keep the same name on restarts. |
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 |
/remove-lifecycle stale |
Though it is possible to add entries to hosts via configmap it's nice and natural to import nodes |
Hi, I'm using a |
Any ideas/progress on this one? |
@asarkar @manigandham would statefulset help you . Their pods get constant dns entries and you can still use a service to round Robin to any of the pods |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle stale |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@fejta-bot: Closing this issue. 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. |
/reopen |
@akshaysin: You can't reopen an issue/PR unless you authored it or you are a collaborator. 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. |
@akshaysin not to kube-dns. you can do it with CoreDNS, probably most easily via the |
I re-create the issue here as suggested by @bowei.
Kubernetes version (use
kubectl version
): v1.5.2Environment:
uname -a
): 3.16.7Current status: entries in /etc/hosts of the nodes are not used by kube-dns. There is no straightforward way to replicate this custom DNS configuration for the cluster.
What I would like: Some way to easily define custom DNS entries used by kube-dns on a cluster-wide level, without deploying an additional DNS server.
Already considered solutions:
all nodesthe node running kube-dns. This works, but it's not convenient for quick/testing deployments. Also, it requires access to the host.Possible solutions:
/etc/hosts
entries, like it does for /etc/resolv.conf. This is not very elegant and doesn't scale, but it replicates a capability currently existing in non containerized system administration.The text was updated successfully, but these errors were encountered: