<p>This is my first time what I'm installing Kubernetes and trying to understand how it works. First problem that I can't solve is opening Dashboard via HTTP protocol using <code>proxy</code> by visting the URL from documentation:</p>

<p><a href="http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/" rel="nofollow noreferrer">http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/</a></p>

<p>Browser's respond is: <em>This site can’t be reached. Localhost refused to connect.</em></p>

<hr>

<h2>Little bit about my environment!</h2>

<p><strong>I've started with virtual machines equipped with:</strong></p>

<ol>
<li>Master: 2 VCPU, 4GB RAM,  Ubuntu 18.04</li>
<li>Worker1: 1 VCPU, 2GB RAM,  Ubuntu 18.04</li>
<li>Worker1: 1 VCPU, 2GB RAM,  Ubuntu 18.04</li>
</ol>

<p>All running and connected to a private network.</p>

<p>So far I followed the instructions to setup production environment by <a href="https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/" rel="nofollow noreferrer">installing kubeadm</a>. Than <a href="https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/create-cluster-kubeadm/" rel="nofollow noreferrer">created a single control-plane cluster with kubeadm</a> without joining any nodes yet.</p>

<p><strong>Environment that I created is:</strong></p>

<ul>
<li>Kubernetes version 1.15 (run as <em>root</em> user)</li>
<li>Docker version 18.09.9 (run as <em>root</em> user)</li>
<li>Calico version 3.8 (run as <em>non-root</em> user)</li>
<li>Dashboard version 2.0.0-beta4 (run as <em>non-root</em> user)</li>
</ul>

<hr>

<p>All seems to be running.</p>

<p><a href="https://i.stack.imgur.com/NYkaJ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NYkaJ.jpg" alt="installing kubernetes dashboard"></a></p>

<p>What I can is to see some respond when I load</p>

<p><a href="https://master-IP:6443/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/" rel="nofollow noreferrer">https://master-IP:6443/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/</a></p>

<p><a href="https://i.stack.imgur.com/YxfXE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YxfXE.png" alt="installing kubernetes dashboard"></a></p>

<p>So what I can't is to open/load Kubernetes Dashboard UI using proxy over HTTP protocol by <a href="https://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/" rel="nofollow noreferrer">official Kubernetes Dashboard documentation</a>.</p>

<hr>

<p>P.S. One thing is unclear to me when setting up a new user to log in to Dashboard using bearer token tied to this user. Shouldn't the value of <code>namespace</code> be changed from <code>kube-system</code> to <code>kubernetes-dashboard</code> according to the <a href="https://github.com/kubernetes/dashboard/releases/tag/v2.0.0-beta1" rel="nofollow noreferrer">changelog of v2.0.0-beta1</a>?</p>

Dominik Krulak
<p>I see that you would like to access the dashboard from your laptop. What you should do is create an admin account called k8s-admin:</p>

<pre><code>$ kubectl --namespace kube-system create serviceaccount k8s-admin
$ kubectl create clusterrolebinding k8s-admin --serviceaccount=kube-system:k8s-admin --clusterrole=cluster-admin
</code></pre>

<p>Then setup kubectl on your laptop / workstation:
For example for macOS it looks like this (see <a href="https://kubernetes.io/docs/tasks/tools/install-kubectl/" rel="nofollow noreferrer">documentation</a>):</p>

<pre><code>$ brew install kubernetes-cli
</code></pre>

<p>Setup a proxy to your workstation. Create a <code>~/.kube</code> directory on your laptop and then scp the <code>~/.kube/config</code> file from the k8s (Kubernetes) master to your <code>~/.kube</code> directory.</p>

<p>Then get the authentication token you need to connect to the dashboard:</p>

<pre><code>$ kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep k8s-admin | awk '{print $1}')
</code></pre>

<p>Store this token, you’ll need it to access the Kubernetes dashboard. Now start the proxy:</p>

<pre><code>$ kubectl proxy
</code></pre>

<p>Now open the dashboard by going to:</p>

<pre><code>http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/
</code></pre>

<p>You should see the <code>Token</code> option and then copy-paste the token from the prior step and Sign-In. </p>

<p>You can follow this <a href="https://medium.com/@salqadri/build-your-own-multi-node-kubernetes-cluster-with-monitoring-346a7e2ef6e2" rel="nofollow noreferrer">tutorial</a>.</p>
