<p>I am deploying separate Kubernetes cluster for each lifecycle i.e. one cluster for dev and a separate cluster for production and will be using namespaces only for logical segregation of application based on there task e.g. all DB in data namespace, UI app in web namespace etc.</p>

<p>Because of this design, there is no need to have namespaces in service or pod's FQDN as each service and deployment will be unique. Can anyone please suggest how I can remove namespaces from hostname e.g. if there is a service named my-service in default namespace I would like to resolve the service from other namespace using "my-service.svc.cluster.local" instead of "my-service.default.svc.cluster.local"</p>

<p>I am running kubernetes 1.10 and using coreDNS.</p>

<p>If you are using the standard DNS config with CoreDNS or KubeDNS you can't change it as described in the other answers.</p>

<p>However, you can change the DNS using a <a href="https://kubernetes.io/docs/tasks/administer-cluster/dns-custom-nameservers/#configuration-of-stub-domain-and-upstream-nameserver-using-coredns" rel="nofollow noreferrer"><code>StubDomain</code></a> and a service discovery tool. One of the more popular ones is <a href="https://www.consul.io" rel="nofollow noreferrer">Consul</a> and <a href="https://www.consul.io/docs/platform/k8s/dns.html" rel="nofollow noreferrer">here's how to configure a stub domain with it</a>.</p>

<p>Note that you will likely have to run your <a href="https://www.consul.io/docs/platform/k8s/index.html" rel="nofollow noreferrer">Consul cluster in Kubernetes</a> if not the server, certainly you will need a consul agent sidecar for your pods.</p>
