Monitor MATLAB Online Server Using Kubernetes Dashboard
The Kubernetes® Dashboard (also known as Web UI) provides a UI that you can use to monitor your
Kubernetes environment. This topic shows how to install and configure the dashboard for a
MATLAB®
Online Server™ single-node configuration running on your localhost
address.
The topic also provides links to Kubernetes documentation for configuring the dashboard for secure remote access and for
configuring dashboards in managed Kubernetes environments.
Prerequisites
You have MATLAB Online Server installed on a single node, as described in Perform Minimal MATLAB Online Server Installation on Single Machine.
The Kubernetes
kubectl
command is configured, as described in Install Kubernetes of the installation instructions.You have a browser installed on your local VM to access your
localhost
address.
Install Dashboard on Single-Node Configuration
These instructions walk you through the basic installation and setup of the Kubernetes Dashboard. For detailed instructions and security configuration options, in the
Kubernetes documentation, see https://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard
.
Deploy the Kubernetes Dashboard. On the
https://github.com/kubernetes/dashboard
page, copy the installation command for the latest version of the dashboard and execute it in your MATLAB Online Server terminal. The command has this format.kubectl apply -f ...
Verify that the installation succeeds by checking the list of pods in your namespaces.
kubectl get pods --all-namespaces
Verify that the list displays two pods in a new
kubernetes-dashboard
namespace. For example:NAMESPACE NAME READY STATUS RESTARTS AGE ... kubernetes-dashboard dashboard-metrics-scraper-7c857855d9-7zj45 1/1 Running 0 10m kubernetes-dashboard kubernetes-dashboard-6b79449649-lpz7t 1/1 Running 0 10m ...
Create a Kubernetes service account in your cluster. This account enables authentication into the dashboard.
To create this account, in your MATLAB Online Server root folder, create a file named
matlab-online-server-admin-account.yaml
and enter this information, exactly as shown.apiVersion: "v1" kind: "ServiceAccount" metadata: name: "matlab-online-server-admin" namespace: "kube-system" --- apiVersion: "rbac.authorization.k8s.io/v1" kind: "ClusterRoleBinding" metadata: name: "matlab-online-server-admin" namespace: "kube-system" roleRef: apiGroup: "rbac.authorization.k8s.io" kind: "ClusterRole" name: "cluster-admin" subjects: - kind: "ServiceAccount"
Apply the file to your Kubernetes cluster.
kubectl apply -f matlab-online-server-admin-account.yaml
Retrieve the bearer token for the created
matlab-online-server-admin
account. Execute this command, and copy or save the returned token. In a later step, you use this token to access the dashboard locally.kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep matlab-online-server-admin | awk '{print $1}') | grep token: | awk '{print $2}'
Start a proxy to enable access to the Kubernetes Dashboard.
kubectl proxy
Access the Kubernetes Dashboard on a local browser at this URL.
https://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/#/login
When prompted for the authentication method, select Token and enter the bearer token you retrieved in a previous step.
Log in to the dashboard. You can now familiarize yourself with the different namespaces for your environment and the administrative features in the Kubernetes Dashboard.
Configure Dashboard for Remote Access
To access your dashboard remotely using HTTPS, additional security configuration options
apply. For details on configuring remote access securely, see https://github.com/kubernetes/dashboard/blob/master/docs/user/README.md
.
Install Dashboard on Managed Kubernetes Provider
The instructions for setting up the Kubernetes Dashboard depends on your provider.
Amazon® Web Services (AWS®) — Set up Kubernetes Dashboard using the Elastic Kubernetes Service managed by AWS. In the Amazon documentation, see
//docs.aws.amazon.com/eks/latest/userguide/dashboard-tutorial.html
.Microsoft® Azure® — Set up Kubernetes Dashboard using the Azure Kubernetes Service managed by Azure. In the Microsoft documentation, see
//docs.microsoft.com/azure/aks/kubernetes-dashboard
.Google® Kubernetes Engine — The open-source Kubernetes Dashboard on the Google Kubernetes Engine managed by Google is deprecated. Google recommends monitoring your environment using the Google Cloud console.
Red Hat® OpenShift® — Red Hat OpenShift provides a default set of administrator features and dashboards that it recommends using to monitor your environment.