Public Cloud > Container > Aruba Managed Kubernetes > Use case: installing Kubernetes Dashboard

1.6 Use case: installing Kubernetes Dashboard

The guide indicated refers to version 2.7.0 of the official documentation.

The Kubernetes Dashboard is a web-based user interface that allows users to administer, monitor, and manage the state of objects within a Kubernetes cluster. It can be used from both a developer-oriented and operation-oriented perspective. This is useful for managing and administering a cluster without using the kubectl CLI or other Kubernetes clients.

The purpose of this page is to describe, step by step, the configuration needed to install the official Kubernetes Dashboard within a KaaS.

The Dashboard service can be provided in two ways: using the kubectl client or without it by publicly exposing the Dashboard service.

1. Creating a Kubernetes cluster

  • sign in to the New Cloud Management Platform;
  • in the left vertical menu, under SERVICES select Manage > Containers;
  • in the Aruba Managed Kubernetes area, click on Create new cluster and continue to configuration;
  • wait until the Kubernetes cluster status is showing as Active;
  • go to the cluster details page;
  • click on Cluster actions on the right and select Download config file from the list of options to download the configuration file to use to access the cluster using kubectl.

2. Installing the Kubernetes Dashboard

  • kubectl must be configured and connected to the cluster.
  • Deploy the Kubernetes objects of the Dashboard application using the following command:

    $> kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.7.0/aio/deploy/recommended.yaml

3. Generating User Token to access the Kubernetes Dashboard

  • A user is generated with cluster-admin permissions to access the Dashboard. The user is named aruba-admin-user. The guide is valid for Kubernetes clusters later than version 1.24, so access tokens are obtained through the service account dedicated to the user.

    $> kubectl create serviceaccount aruba-admin-user

    $> kubectl create clusterrolebinding aruba-admin-user-binding \
       --clusterrole cluster-admin \
       --serviceaccount default:aruba-admin-user

    $> kubectl create token aruba-admin-user

  • Save the token received to enter into the Dashboard and login.

4. Accessing the Web Dashboard

  • There are two ways to access it: direct distribution of the config file to access the service using the Kubernetes Proxy or exposing the service on the Internet using Aruba Cloud Elastic IP.

    Accessing the Web Dashboard using Kubernetes Proxy

    • kubectl must be configured and connected to the cluster.
    • Open a local tunnel to the machine using the following command:

      $> kubectl proxy

    • Reach the following address via web browser:

      $> http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/

    Accessing the Web Dashboard via Elastic IP

    The value of the IP addresses is purely for example purposes.
    • The access method requires an Elastic IP to be associated with a Load Balancer, which is then connected to the created Kubernetes cluster. Therefore, you first need to create the Elastic IP and then proceed to the dedicated section.
    • Assign a logical name to the resource.
    • Select the destination project of the Elastic IP.
    • Complete the purchase.
    • At this point the resource status updates to InCreation.
    • When provisioning is completed, the status updates to Not Used to show that the resource is available to be assigned to an Aruba Load Balancer when created.
    • We then expose the Kubernetes deployment as a Load Balancer to use the newly reserved Elastic IP.

      $> kubectl -n kubernetes-dashboard expose deployment --name kube-dashboard-lb --type=LoadBalancer --port=8443 kubernetes-dashboard

    • When the resource is assigned to a Load Balancer, the state changes to Reserved. From the Kubernetes SVC object, you can see the assigned external IP, which allows you to access the Dashboard via the public IP.
    • At this point the Dashboard can be reached at URL https://<PUBLIC_IP>:8443