<p>I installed microk8s on my ubuntu machine based on steps here <a href="https://ubuntu.com/kubernetes/install#single-node" rel="nofollow noreferrer">https://ubuntu.com/kubernetes/install#single-node</a></p>
<p>Then I followed kubernetes official tutorial and created and exposed a deployment like this</p>
<pre><code>microk8s.kubectl create deployment kubernetes-bootcamp --image=gcr.io/google-samples/kubernetes-bootcamp:v1

microk8s.kubectl expose deployment/kubernetes-bootcamp --type=NodePort --port 8083
</code></pre>
<p>This is my <code>kubectl get services</code> output</p>
<pre><code>akila@ubuntu:~$ microk8s.kubectl get services
NAME                  TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)          AGE
kubernetes            ClusterIP   10.152.183.1    &lt;none&gt;        443/TCP          25h
kubernetes-bootcamp   NodePort    10.152.183.11   &lt;none&gt;        8083:31695/TCP   17s
</code></pre>
<p>This is my <code>kubectl get pods</code> output</p>
<pre><code>akila@ubuntu:~$ microk8s.kubectl get pods
NAME                                   READY   STATUS    RESTARTS   AGE
kubernetes-bootcamp-6f6656d949-rllgt   1/1     Running   0          51m
</code></pre>
<p>But I can't access the service from my browser using <code>http://localhost:8083</code> OR using <code>http://10.152.183.11:31695</code></p>
<p>When I tried http://localhost:31695 I'm getting ERR_CONNECTION_REFUSED.</p>
<p>How can I access this &quot;kubernetes-bootcamp&quot; service from my browser ?
Am I mising anything ?</p>

<p>The IP <code>10.152.183.11</code>  is <code>CLUSTER-IP</code> and not accessible from outside the cluster i.e from a browser. You should be using <code>http://localhost:31695</code> where <code>31695</code> is the <code>NodePort</code> opened on the host system.</p>
<p>The container of the <code>gcr.io/google-samples/kubernetes-bootcamp:v1</code> image need to listen on port <code>8083</code> because you are exposing it on that port. Double check that because otherwise this will lead to <code>ERR_CONNECTION_REFUSED</code> error.</p>
<p>If the container is listening on port <code>8080</code> then use below command to expose that port</p>
<pre><code>microk8s.kubectl expose deployment/kubernetes-bootcamp --type=NodePort --port 8080
</code></pre>
