<p>I created an ubuntu instance on gcloud and installed minikube and all the required dependency in it.
Now I can do curl from gnode terminal &quot;curl <a href="http://127.0.0.1:8080/api/v1/namespaces/kubernetes-dashboard/services/http:kubernetes-dashboard:/proxy/%22" rel="nofollow noreferrer">http://127.0.0.1:8080/api/v1/namespaces/kubernetes-dashboard/services/http:kubernetes-dashboard:/proxy/&quot;</a> I get the HTML response back.</p>
<p>But I want to Access this URL from my Laptop browser.
I tried opening these Ports in
firewall of instance-node tcp:8080,8085,443,80,8005,8006,8007,8009,8009,8010,7990,7992,7993,7946,4789,2376,2377</p>
<p>But still unable to access the above mentioned url while replacing it with my <strong>external(39.103.89.09) IP</strong>
i.e <a href="http://39.103.89.09:8080/api/v1/namespaces/kubernetes-dashboard/services/http:kubernetes-dashboard:/proxy/" rel="nofollow noreferrer">http://39.103.89.09:8080/api/v1/namespaces/kubernetes-dashboard/services/http:kubernetes-dashboard:/proxy/</a></p>
<p>I believe I need to do some networking related changes but don't know what.</p>
<p>I am very new to Cloud computing and networking so please help me.</p>

<p>I suspect that minikube binds to the VM's localhost interface making it inaccessible from a remote machine.</p>
<p>There may be a way to run minikube such that it binds to <code>0.0.0.0</code> and then you may be able to use it remotely.</p>
<p>Alternatively, you can keep the firewall limited to e.g. <code>22</code> and use SSH to port-forward the VM's port <code>8080</code> to your localhost. `gcloud' includes a helper for this too:</p>
<ol>
<li>Ensure minikube is running on the VM</li>
<li><code>gcloud compute ssh ${INSTANCE} --project=${PROJECT} --zone=${ZONE} --ssh-flag=&quot;-L 8080:localhost:8080&quot;</code></li>
<li>Try accessing Kubernetes endpoints from your <strong>local</strong> machine using <code>localhost:8080/api/v1/...</code></li>
</ol>
<h3>Update</h3>
<p>OK, I created a Debian VM (<code>n1-instance-2</code>), installed <code>docker</code> and <code>minikube</code>.</p>
<p>SSH'd into the instance:</p>
<pre class="lang-sh prettyprint-override"><code>gcloud compute ssh ${INSTANCE} \
--zone=${ZONE} \
--project=${PROJECT}
</code></pre>
<p>Then <code>minikube start</code></p>
<p>Then:</p>
<pre class="lang-sh prettyprint-override"><code>minikube kubectl -- get namespaces
NAME              STATUS   AGE
default           Active   14s
kube-node-lease   Active   16s
kube-public       Active   16s
kube-system       Active   16s
</code></pre>
<p>minikube appears (I'm unfamiliar it) to run as a Docker container called <code>minikube</code> and it exposes 4 ports to the VM's (!) localhost: <code>22</code>,<code>2376</code>,<code>5000</code>,<code>8443</code>. The latter is key.</p>
<p>To determine the port mapping, either eyeball it:</p>
<pre class="lang-sh prettyprint-override"><code>docker container ls \
--filter=name=minikube \
--format=&quot;{{.Ports}}&quot; \
| tr , \\n
</code></pre>
<p>Returns something like:</p>
<pre><code>127.0.0.1:32771-&gt;22/tcp
127.0.0.1:32770-&gt;2376/tcp
127.0.0.1:32769-&gt;5000/tcp
127.0.0.1:32768-&gt;8443/tcp
</code></pre>
<p>In this case, the port we're interested in is <code>32768</code></p>
<p>Or:</p>
<pre class="lang-sh prettyprint-override"><code>docker container inspect minikube \
--format=&quot;{{ (index (index .NetworkSettings.Ports \&quot;8443/tcp\&quot;) 0).HostPort }}&quot;
32768
</code></pre>
<p>Then, exit the shell and return using <code>--ssh-flag</code>:</p>
<pre class="lang-sh prettyprint-override"><code>gcloud compute ssh ${INSTANCE} \
--zone=${ZONE} \
--project=${PROJECT} \
--ssh-flag=&quot;-L 8443:localhost:32768&quot;
</code></pre>
<blockquote>
<p><strong>NOTE</strong> <code>8443</code> will be the port on the localhost; <code>32768</code> is the remote minikube port</p>
</blockquote>
<p>Then, from another shell on your local machine (and while the port-forwarding <code>ssh</code> continues in the other shell), pull the <code>ca.crt</code>, <code>client.key</code> and <code>client.crt</code>:</p>
<pre class="lang-sh prettyprint-override"><code>gcloud compute scp \
$(whoami)@${INSTANCE}:./.minikube/profiles/minikube/client.* \
${PWD} \
--zone=${ZONE} \
--project=${PROJECT} 

gcloud compute scp \
$(whoami)@${INSTANCE}:./.minikube/ca.crt \
${PWD} \
--zone=${ZONE} \
--project=${PROJECT}
</code></pre>
<p>Now, create a config file, call it <code>kubeconfig</code>:</p>
<pre><code>apiVersion: v1
clusters:
- cluster:
    certificate-authority: ./ca.crt
    server: https://localhost:8443
  name: minikube
contexts:
- context:
    cluster: minikube
    user: minikube
  name: minikube
current-context: minikube
kind: Config
preferences: {}
users:
- name: minikube
  user:
    client-certificate: ./client.crt
    client-key: ./client.key
</code></pre>
<p>And, lastly:</p>
<pre class="lang-sh prettyprint-override"><code>KUBECONFIG=./kubeconfig kubectl get namespaces
</code></pre>
<p>Should yield:</p>
<pre><code>NAME              STATUS   AGE
default           Active   23m
kube-node-lease   Active   23m
kube-public       Active   23m
kube-system       Active   23m
</code></pre>
