5 Minutes to Kubernetes Dashboard running on Docker Desktop for Windows 2.0.0.3

Estimated Reading Time: 6 minutes



If you want to get started with Kubernetes on your Laptop running Windows 10, Docker Desktop for Windows CE is the quickest way. Docker Desktop is the preferred choice for millions of developers that are building containerized applications for couple of reasons. The major reasons being –

  • 1-click installation and setup of a complete Docker development environment for Windows
  • Integrated tools including the Docker command lineDocker Compose and kubectl command line
  • Ability to start/stop with a single click
  • In-built Single Node Kubernetes Cluster

Docker Desktop is an easy-to-install application for your Mac or Windows environment that enables you to start coding and containerizing in minutes. Docker Desktop includes everything you need to build, test and ship containerized applications right from your machine.

Today Docker Desktop for Windows comes in two flavour – Docker Desktop Community & Docker Desktop Enterprise. You can download these editions via the below link:

Please note that you will need license file for Docker Desktop Enterprise to be installed on your Windows Laptop. Also, you will need to remove Docker Desktop Community Edition before you go ahead and install Enterprise release.


Docker Desktop Enterprise takes Docker Desktop Community, formerly known as Docker for Windows and Docker for Mac, a step further with simplified enterprise application development and maintenance. With Docker Desktop Enterprise, IT organizations can ensure developers are working with the same version of Docker Desktop Enterprise and can easily distribute Docker Desktop Enterprise to large teams using a number of third-party endpoint management applications. With the Docker Desktop Enterprise graphical user interface (GUI), developers are no longer required to work with lower-level Docker commands and can auto-generate Docker artifacts

Installing Docker Desktop for Windows 2.0.0.3 Platform

Let us started with a simple installation of Docker Desktop Community Release. Open https://hub.docker.com/editions/community/docker-ce-desktop-windows and click on “Login to Download” page to download and install Docker Desktop for Windows. Once you install Docker Desktop, you can see “whale” icon appear in the below taskbar(as shown below):

Checking Docker Version

There are two ways to verify Docker version – one through UI and other via CLI. To verify it via CLI, all you need is to run docker version to check the basic details of your deployment. You should see “Windows” listed as the operating system for the Docker client and the Docker Engine:

Client: Docker Engine - Community
 Version:           18.09.2
 API version:       1.39
 Go version:        go1.10.8
 Git commit:        6247962
 Built:             Sun Feb 10 04:12:31 2019
 OS/Arch:           windows/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          18.09.2
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.6
  Git commit:       6247962
  Built:            Sun Feb 10 04:13:06 2019
  OS/Arch:          linux/amd64
  Experimental:     true
 Kubernetes:
  Version:          v1.10.11
  StackAPI:         v1beta2
PS C:\Users\Ajeet_Raina>

The OS/Arch field tells you the operating system and CPU architecture you’re using. Docker is cross-platform, so you can manage Windows Docker servers from a Linux client and vice-versa, using the same docker commands.

Open up Whale icon which you see in the taskbar menu and browse through “Settings”. Click on Kubernetes and select the options shown below to bring up Kubernetes cluster.

Based on your internet speed, you need to wait for single node kubernetes cluster to come up. Once the UI shows “Kubernetes is running”, you should be good to go ahead and perform the below commands.

Verify the Kubectl

PS C:\WINDOWS\system32> kubectl version
Client Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.11", GitCommit:"637c7e288581ee40ab4
b6e7e9", GitTreeState:"clean", BuildDate:"2018-11-26T14:38:32Z", GoVersion:"go1.9.3", Compiler:"gc", Plat
md64"}
Server Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.11", GitCommit:"637c7e288581ee40ab4
b6e7e9", GitTreeState:"clean", BuildDate:"2018-11-26T14:25:46Z", GoVersion:"go1.9.3", Compiler:"gc", Plat
64"}
PS C:\WINDOWS\system32>



Setting up Kubernetes Dashboard

Dashboard is a web-based Kubernetes user interface. You can use Dashboard to deploy containerized applications to a Kubernetes cluster, troubleshoot your containerized application, and manage the cluster resources. You can use Dashboard to get an overview of applications running on your cluster, as well as for creating or modifying individual Kubernetes resources (such as Deployments, Jobs, DaemonSets, etc). For example, you can scale a Deployment, initiate a rolling update, restart a pod or deploy new applications using a deploy wizard.

Dashboard also provides information on the state of Kubernetes resources in your cluster and on any errors that may have occurred.

Let us go ahead and test drive Kubernetes dashboard in just 2 minutes.

PS C:\Users\Ajeet_Raina> kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v1.10.1/src/deploy/recommended/kubernetes-dashboard.yaml
secret "kubernetes-dashboard-certs" created
serviceaccount "kubernetes-dashboard" created
role.rbac.authorization.k8s.io "kubernetes-dashboard-minimal" created
rolebinding.rbac.authorization.k8s.io "kubernetes-dashboard-minimal" created
deployment.apps "kubernetes-dashboard" created
service "kubernetes-dashboard" created
PS C:\Users\Ajeet_Raina>

You can access Dashboard using the kubectl command-line tool by running the following command:

PS C:\Users\Ajeet_Raina> kubectl proxy
Starting to serve on 127.0.0.1:8001

Go to http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/ on Browser and you will get the below output:

{
  "kind": "Status",
  "apiVersion": "v1",
  "metadata": {
    
  },
  "status": "Failure",
  "message": "no endpoints available for service \"kubernetes-dashboard\"",
  "reason": "ServiceUnavailable",
  "code": 503
}
curl http://localhost:8001/api

{
  "kind": "APIVersions",
  "versions": [
    "v1"
  ],
  "serverAddressByClientCIDRs": [
    {
      "clientCIDR": "0.0.0.0/0",
      "serverAddress": "192.168.65.3:6443"
    }
  ]
}
{
  "paths": [
    "/api",
    "/api/v1",
    "/apis",
    "/apis/",
    "/apis/admissionregistration.k8s.io",
    "/apis/admissionregistration.k8s.io/v1beta1",
    "/apis/apiextensions.k8s.io",
    "/apis/apiextensions.k8s.io/v1beta1",
    "/apis/apiregistration.k8s.io",
    "/apis/apiregistration.k8s.io/v1",
    "/apis/apiregistration.k8s.io/v1beta1",
    "/apis/apps",
    "/apis/apps/v1",
    "/apis/apps/v1beta1",
    "/apis/apps/v1beta2",
    "/apis/authentication.k8s.io",
    "/apis/authentication.k8s.io/v1",
    "/apis/authentication.k8s.io/v1beta1",
    "/apis/authorization.k8s.io",
    "/apis/authorization.k8s.io/v1",
    "/apis/authorization.k8s.io/v1beta1",
    "/apis/autoscaling",
    "/apis/autoscaling/v1",
    "/apis/autoscaling/v2beta1",
    "/apis/batch",
    "/apis/batch/v1",
    "/apis/batch/v1beta1",
    "/apis/certificates.k8s.io",
    "/apis/certificates.k8s.io/v1beta1",
    "/apis/compose.docker.com",
    "/apis/compose.docker.com/v1beta1",
    "/apis/compose.docker.com/v1beta2",
    "/apis/events.k8s.io",
    "/apis/events.k8s.io/v1beta1",
    "/apis/extensions",
    "/apis/extensions/v1beta1",
    "/apis/networking.k8s.io",
    "/apis/networking.k8s.io/v1",
    "/apis/policy",
    "/apis/policy/v1beta1",
    "/apis/rbac.authorization.k8s.io",
    "/apis/rbac.authorization.k8s.io/v1",
    "/apis/rbac.authorization.k8s.io/v1beta1",
    "/apis/storage.k8s.io",
    "/apis/storage.k8s.io/v1",
    "/apis/storage.k8s.io/v1beta1",
    "/healthz",
    "/healthz/autoregister-completion",
    "/healthz/etcd",
    "/healthz/ping",
    "/healthz/poststarthook/apiservice-openapi-controller",
    "/healthz/poststarthook/apiservice-registration-controller",
    "/healthz/poststarthook/apiservice-status-available-controller",
    "/healthz/poststarthook/bootstrap-controller",
    "/healthz/poststarthook/ca-registration",
    "/healthz/poststarthook/generic-apiserver-start-informers",
    "/healthz/poststarthook/kube-apiserver-autoregistration",
    "/healthz/poststarthook/rbac/bootstrap-roles",
    "/healthz/poststarthook/start-apiextensions-controllers",
    "/healthz/poststarthook/start-apiextensions-informers",
    "/healthz/poststarthook/start-kube-aggregator-informers",
    "/healthz/poststarthook/start-kube-apiserver-informers",
    "/logs",
    "/metrics",
    "/openapi/v2",
    "/swagger-2.0.0.json",
    "/swagger-2.0.0.pb-v1",
    "/swagger-2.0.0.pb-v1.gz",
    "/swagger.json",
    "/swaggerapi",
    "/version"
  ]
}

Wait, where is the dashboard?

Browse to http://:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/ and this shall open up kubeconfig page as shown below:

Run the below command to set token:

PS C:\Users\Ajeet_Raina\Desktop> $TOKEN=((kubectl -n kube-system describe secret default | Select-String "token:") -split " +")[1]

PS C:\Users\Ajeet_Raina\Desktop> kubectl config set-credentials docker-for-desktop --token="${TOKEN}"



Click on Kubeconfig and select the “config” file under C:\Users<Username>.kube\config

That’s it. You should be able to access Kubernetes Dashboard as shown below:

You can view the nodes details under Dashboard:

Viewing the Namespace:

You can get quick view of roles by clicking on “Roles” on the left side of the UI:

Viewing the Storage Classes:

Viewing the services:

Further Readings:

Clap

(29)