Table of contents
According to the Kubernetes documentation:
"Dashboard is a web-based Kubernetes user interface. You can use Dashboard to deploy containerized applications to a Kubernetes cluster, troubleshoot your containerized applications, and manage the cluster resources."
Below is a step-by-step guide on installing the Kubernetes Dashboard and accessing it using a token issued in the customer portal.
The installation command depends on the Dashboard version. In case of errors in the console output or updates, refer to the Kubernetes documentation.
Kubernetes Dashboard supports only Helm-based installation currently as it is faster and gives us better control over all dependencies required by Dashboard to run.
Helm
helm repo add kubernetes-dashboard https://kubernetes.github.io/dashboard/
helm upgrade --install kubernetes-dashboard kubernetes-dashboard/kubernetes-dashboard --create-namespace --namespace kubernetes-dashboard
The Kubernetes Dashboard will now be deployed in your cluster.
This example demonstrates how to create a user account with administrative rights. If you need to create a new user, assign permissions, and generate an individual token for that user, refer to the creating a sample user.
dashboard-adminuser.yaml
) and add the following snippets to it:
ServiceAccount
with the name admin-user
in namespace kubernetes-dashboard
:
apiVersion: v1
kind: ServiceAccount
metadata:
name: admin-user
namespace: kubernetes-dashboard
ClusterRoleBinding
for the ServiceAccount
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: admin-user
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: admin-user
namespace: kubernetes-dashboard
kubectl apply -f {path to the dashboard-adminuser.yaml file}
The user account has now been successfully created.
You can enable access to the Dashboard using the kubectl
command-line tool, by executing the following command:
kubectl -n kubernetes-dashboard port-forward svc/kubernetes-dashboard-kong-proxy 8443:443
Kubectl
will make Dashboard available at https://localhost:8443.
In the Bearer Token field, enter the value obtained from the customer portal → Kubernetes Cluster Details → Secret field.
The UI can only be accessed from the machine where the command is executed. Use the kubectl port-forward --help
command for more options.