Bypassing authentication for the local Kubernetes Cluster Dashboard

Premier Developer

Premier

Premier Developer Consultant Randy Patterson shares a tip to bypass authentication for the local Kubernetes Cluster Dashboard.


It’s no secret that you can run a local version of Kubernetes on Docker Desktop for Windows, however, getting the Dashboard installed and configured correctly can be challenging. The problem is that the default installation requires you to manage an admin user and copy that user’s bearer token into the portal to login. This process is fine for shared clusters but for a local cluster it just makes using the dashboard cumbersome. Fortunately, there is an easy workaround and this blog post will guide you through the process.

Once your local Kubernetes cluster is up and running, it’s time to configure and install the dashboard with the ability to skip the login process.

At the time of this writing the released version of the dashboard was 1.10.1, check the Github page for the latest version

First, open a PowerShell prompt and download the latest Kubernetes Dashboard YAML file.

Next, open the downloaded file in your favorite text editor, I’ll use VS Code.

Locate the container -> args section under the Dashboard-Deployment section (around line 116) and add the following command line arguments:

Your modified args section should look like the following

Save your changes and exit the text editor then install the dashboard from a PowerShell prompt in the same directory as the kubernetes-dashboard.yaml file:

The output should look something like this:

Finally, connect to the dashboard proxy

then navigate to web site:

http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/

You can now skip the login process and navigate directly to the Dashboard Overview

C:\Users\ranpat\AppData\Local\Temp\SNAGHTMLe3395f6.PNG

This configuration option can be used on any Kubernetes Dashboard installation including Windows or Linux deployments. Bypassing the dashboard authentication can be a real time saver when testing with the locally deployed Kubernetes cluster.

Premier Developer
Premier Developer

Premier Support for Developers

Follow Premier   

0 comments

    Leave a comment