From 40b4d15afa89ba7a0f05cd8d1057412334b7016f Mon Sep 17 00:00:00 2001 From: Bartek Grzybowski Date: Thu, 1 Apr 2021 15:05:00 +0200 Subject: Add usage instructions for Kubernetes Dashboard This adds a new section to the install guide describing details on accessing the k8s dashboard web UI that comes preinstalled with Offline platform. Change-Id: I16bd80ce1274744db2572993a910c12efc226920 Issue-ID: OOM-2715 Signed-off-by: Bartek Grzybowski --- docs/InstallGuide.rst | 61 ++++++++++++++++++++++++++++ docs/images/kubernetes-dashboard-main.png | Bin 0 -> 137911 bytes docs/images/kubernetes-dashboard-signin.png | Bin 0 -> 45941 bytes 3 files changed, 61 insertions(+) create mode 100644 docs/images/kubernetes-dashboard-main.png create mode 100644 docs/images/kubernetes-dashboard-signin.png (limited to 'docs') diff --git a/docs/InstallGuide.rst b/docs/InstallGuide.rst index 6c0ec76f..61c52cc2 100644 --- a/docs/InstallGuide.rst +++ b/docs/InstallGuide.rst @@ -540,6 +540,67 @@ Usage is basically the same as with the default chroot way - the only difference ----- +Appendix 2. Running Kubernetes Dashboard +---------------------------------------- + +Kubernetes Dashboard is a web-based, general purpose user interface for managing a k8s cluster. + +Some of its capabilities are: + +* workloads/services management (troubleshooting, scaling, editing, restarting pods) +* deploying new workloads/applications to the cluster +* managing the cluster itself + +Dashboard also provides information on the state of the cluster resources and on any errors that may have occurred. + +Kubernetes Dashboard itself is a kubernetes application. For user convenience the Offline platform has it already pre-installed: + +:: + + $ kubectl -n kubernetes-dashboard get deployment + NAME READY UP-TO-DATE AVAILABLE AGE + dashboard-metrics-scraper 1/1 1 1 76m + kubernetes-dashboard 1/1 1 1 76m + +Accessing the dashboard +~~~~~~~~~~~~~~~~~~~~~~~ + +There are multiple ways to access the application's web UI. Here we'll assume usage of local port forwarding on a box where you have access to a browser since the dashboard in Offline platform is exposed via a node port by default. + +First get the node port number that the dashboard service is exposed on: + +:: + + $ kubectl -n kubernetes-dashboard get svc kubernetes-dashboard -o custom-columns=PORTS:.spec.ports[].nodePort + PORTS + 30825 + +Now establish an ssh session to the infra node from your box from which you'll be accessing the dashboard: + +:: + + $ ssh -L 8080:127.0.0.1:30825 root@ + +Point your browser at https://localhost:8080/ and you should see the login page: + +.. image:: images/kubernetes-dashboard-signin.png + :alt: Kubernetes Dashboard signin + +Here, we'll leverage the Bearer Token to log in. Offline platform comes with dashboard admin user already created, we just need to extract its token. On the infra node issue following command: + +:: + + $ kubectl -n kubernetes-dashboard get secret $(kubectl -n kubernetes-dashboard get sa/admin-user -o jsonpath="{.secrets[0].name}") -o go-template="{{.data.token | base64decode}}" + +It will return the token string on stdout. Copy-paste it into the sign-in form, selecting the "Token" option first. Upon successful login you'll be presented the cluster resources from ``default`` namespace. In the drop down box at the top select the namespace into which you installed the Onap application (namespace name equals the value of ``app_name`` variable from offline-installer setup) and you should see the cluster resources for Onap: + +.. image:: images/kubernetes-dashboard-main.png + :alt: Kubernetes Dashboard main page + +For additional information concerning the Kubernetes Dashboard please refer to the `official documentation `_. + +----- + .. _Build Guide: ./BuildGuide.rst .. _Software requirements: https://docs.onap.org/projects/onap-oom/en/latest/oom_cloud_setup_guide.html#software-requirements .. _Hardware requirements: https://docs.onap.org/projects/onap-oom/en/latest/oom_cloud_setup_guide.html#minimum-hardware-configuration diff --git a/docs/images/kubernetes-dashboard-main.png b/docs/images/kubernetes-dashboard-main.png new file mode 100644 index 00000000..f16a590c Binary files /dev/null and b/docs/images/kubernetes-dashboard-main.png differ diff --git a/docs/images/kubernetes-dashboard-signin.png b/docs/images/kubernetes-dashboard-signin.png new file mode 100644 index 00000000..d38d865b Binary files /dev/null and b/docs/images/kubernetes-dashboard-signin.png differ -- cgit 1.2.3-korg