<p>I have a Minikube installation in which I created a simple hello-world deployment like this:</p>

<pre><code>kubectl create deployment hello-node \
    --image=gcr.io/hello-minikube-zero-install/hello-node
</code></pre>

<p>I exposed the deployment via a service in the following way:</p>

<pre><code>kubectl expose deployment hello-node --type=LoadBalancer --port=8080
</code></pre>

<p>Now If I call: <code>http://&lt;local cluster ip&gt;:8080</code> it prints "Hello World!" as expected.</p>

<p><strong>What I want to achieve:</strong></p>

<p>I want to expose different deployments in the same cluster to different sub-domains of the cluster. For instance, deployment <code>hello1</code> to <code>hello1.my-k8-cluster.com</code>, <code>hello2</code> to <code>hello2.my-k8-cluster.com</code>.</p>

<p>I want to test this locally because later I will do the same on a real cluster.</p>

<p><strong>Question:</strong> How to test DNS configurations of services locally? How to define sub-domains in services?</p>

<p><strong>What I tried so far:</strong>
I went through the how-to guides <a href="https://kubernetes.io/docs/tutorials/hello-minikube/#create-a-deployment" rel="nofollow noreferrer">here</a> and <a href="https://kubernetes.io/docs/concepts/services-networking/service/" rel="nofollow noreferrer">the documentation</a> which though didn't bring me a clear picture on how to configure what I want.</p>

Sasha Shpota
<p>You cannot define subdomains on Services. Services have the form <code>service-name.namespace.svc.domain</code>.</p>

<p>If you want to manipulate the DNS names, you should look at <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/" rel="nofollow noreferrer">Ingress</a>.</p>

<p>In order to test DNS configurations, you can use normal DNS testing tools like dig from inside a container. You can use public images like <a href="https://hub.docker.com/r/tutum/dnsutils" rel="nofollow noreferrer">dnsutils</a> or create your own testing images for this purpose.</p>
