[Kubernetes (K8S)] Helm install kubernetes-dashboard for web-based UI for Kubernetes (K8S)

kubernetes-dashboard

kubernetes-dashboard is a general purpose, web-based UI for Kubernetes clusters. It allows users to manage applications running in the cluster and troubleshoot them, as well as manage the cluster itself.

This article is about how to use Helm to deploy kubernetes-dashboard on Kubernetes (K8S).

Prerequisites

  • Kubernetes (K8S)
    Kubernetes (K8s) is an open-source system for automating deployment, scaling, and management of containerized applications.

    For more information about installing and using Kubernetes (K8s), see the Kubernetes (K8s) Docs.

  • Helm
    Helm is the best way to find, share, and use software built for Kubernetes.

    For more information about installing and using Helm, see the Helm Docs.

Installation

Custom Values.yaml

Remember to replace the content within < > with your info.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# values.yaml

# dashboard/values.yaml at master · kubernetes/dashboard
# https://github.com/kubernetes/dashboard/blob/master/aio/deploy/helm-chart/kubernetes-dashboard/values.yaml

ingress:
## If true, Kubernetes Dashboard Ingress will be created.
##
enabled: true
annotations:
kubernetes.io/ingress.class: nginx
kubernetes.io/tls-acme: 'true'
cert-manager.io/acme-challenge-type: dns01
cert-manager.io/cluster-issuer: cert-manager-webhook-dnspod-cluster-issuer

# nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
# nginx.ingress.kubernetes.io/secure-backends: "true"

## Kubernetes Dashboard Ingress hostnames
## Must be provided if Ingress is enabled
##
hosts:
- <Your kubernetes-dashboard Host>

## Kubernetes Dashboard Ingress TLS configuration
## Secrets must be manually created in the namespace
##
tls:
- secretName: cert-manager-webhook-dnspod-letsencrypt
hosts:
- <Your kubernetes-dashboard Host>

Install by Helm

Helm install kubernetes-dashboard into kubernetes-dashboard namespace.

1
2
3
4
5
6
7
8
9
10
11
# crate namespace:
$ kubectl create namespace kubernetes-dashboard

# Add the Helm repository:
$ helm repo add kubernetes-dashboard https://kubernetes.github.io/dashboard/

# Update your local Helm chart repository cache:
$ helm repo update

# To install Helm chart:
$ helm install kubernetes-dashboard kubernetes-dashboard/kubernetes-dashboard --namespace kubernetes-dashboard -f values.yaml

See Helm release about kubernetes-dashboard.

1
2
3
$ helm list --namespace kubernetes-dashboard
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
kubernetes-dashboard kubernetes-dashboard 3 2020-10-03 20:48:11.915605 +0800 +0800 deployed kubernetes-dashboard-2.7.1 2.0.4

See pods about kubernetes-dashboard.

1
2
3
$ kubectl get pods -n kubernetes-dashboard
NAME READY STATUS RESTARTS AGE
kubernetes-dashboard-5598bc4755-wc8kw 1/1 Running 6 14d

Get kubernetes-dashboard Token:

1
$ kubectl describe secret `kubectl get secret -n kubernetes-dashboard | grep kubernetes-dashboard-token | awk '{print $1}'` -n kubernetes-dashboard | grep 'token:

Then, you can visit kubernetes-dashboard web-based UI with https://

References

[1] dashboard/aio/deploy/helm-chart/kubernetes-dashboard at master · kubernetes/dashboard · GitHub - https://github.com/kubernetes/dashboard/tree/master/aio/deploy/helm-chart/kubernetes-dashboard

[2] kubernetes/dashboard: General-purpose web UI for Kubernetes clusters - https://github.com/kubernetes/dashboard

[3] kubernetes-dashboard 2.8.2 · helm/k8s-dashboard - https://artifacthub.io/packages/helm/k8s-dashboard/kubernetes-dashboard

[4] dashboard/creating-sample-user.md at master · kubernetes/dashboard - https://github.com/kubernetes/dashboard/blob/master/docs/user/access-control/creating-sample-user.md

[5] Helm - https://helm.sh/

[6] Kubernetes - https://kubernetes.io/