<p>So I am fairly new to Kubernetes. I am a Windows user (sorry) and have installed Minikube. I am trying to learn Kubenetes using MiniKube. I have created very simple REST API that should work with port 5000 exposed where there is a simple route /Hello/{somestring} </p>

<p>I have created a POD/Deployment and Service for this successfully in MiniKube like this</p>

<pre><code>minikube.exe start --kubernetes-version="v1.9.0" --vm-driver="hyperv" --memory=1024 --hyperv-virtual-switch="Minikube Switch" --v=7 --alsologtostderr 
kubectl run simple-sswebapi-pod-v1 --replicas=1 --labels="run=sswebapi-pod-v1" --image=sachabarber/sswebapp:v1  --port=5000
kubectl expose deployment simple-sswebapi-pod-v1 --type=NodePort --name=simple-sswebapi-service
kubectl get services simple-sswebapi-service
</code></pre>

<p>Which I can then grab the url from and paste into my browser like so</p>

<pre><code>minikube service simple-sswebapi-service --url 
</code></pre>

<p>Which gives me this URL</p>

<p><strong><a href="http://192.168.0.29:32246" rel="nofollow noreferrer">http://192.168.0.29:32246</a></strong></p>

<p>Which I then try in the browser on my host, all is good my REST API is running as expected</p>

<p><a href="https://i.stack.imgur.com/J0hKp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/J0hKp.png" alt="enter image description here"></a></p>

<p>But from what I have read, I believe I should be able to ALSO use a DNS name for the service rather than this url returned above.</p>

<p>In fact I am not sure what this IP address returned as part of the --url command is trying to tell me above. It is not one of the ones listed for the service endpoints for is it for the POD from what I can tell from the Dashboard.</p>

<p>This is the service</p>

<p><a href="https://i.stack.imgur.com/2Gqjn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2Gqjn.png" alt="enter image description here"></a></p>

<p>This is the POD</p>

<p><a href="https://i.stack.imgur.com/i6ZqV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/i6ZqV.png" alt="enter image description here"></a></p>

<p>Shouldn't there be a DNS name available for the service that I should be able to use instead of this fairly hacky way of grabbing the url from the service I just created. Someone please let me know what this --url even represents. I am lost here</p>

<p>I have checked that the DNS add on is enabled in MiniKube it is, see <strong>kube-dns</strong> in list below</p>

<p><a href="https://i.stack.imgur.com/5DAeg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5DAeg.png" alt="enter image description here"></a></p>

<p>As I say this is also what I see for the service inside of the MiniKube Dashboard</p>

<p><a href="https://i.stack.imgur.com/oh44J.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oh44J.png" alt="enter image description here"></a></p>

<p>This confused me even more as I cant seem to tie any of that back to the ONLY IP address that seems to actually work for me, which is the one I grabbed using this line from the service</p>

<pre><code>.\minikube.exe service simple-sswebapi-service --url 
</code></pre>

<p>This Ip Address is not shown in the dashboard at all.</p>

<p>I thought the service should be available at DNS name something like:</p>

<p><strong>simple-sswebapi-service.default.svc.cluster.local</strong></p>

<p>Which is the </p>

<ul>
<li>The name of the service</li>
<li>The namespace</li>
<li>svc to tell its a service</li>
</ul>

<p>Just for completeness this is me describing the service in command line</p>

<p><a href="https://i.stack.imgur.com/pUIio.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pUIio.png" alt="enter image description here"></a></p>

<p>What am I missing?</p>

<p>Is my mental mode wrong. I should be able to see this service using a DNS in the host too? Or is the DNS name ONLY available inside the PODS?</p>

<p>kube-dns is internal DNS. You can only use the DNS name for a service from inside the cluster. </p>

<p>Since your service type is Nodeport, you can connect to the service using the IP of the machine (minikube) on that port.</p>
