Quantcast
Viewing all articles
Browse latest Browse all 369

Kubernetes /Minikube – Enable Dashboard – RHEL 7 / CentOS 7

Are you missing Kubenertes Dashboard on Minikube deployment? This article will walk through how to enable the dashboard on Minikube deployment on localhost and remote client. The dashboard is a web-based user interface for Kubernetes. Web-UI is useful to deploy containerized applications in Kubernetes cluster and manage the cluster resources. It could also help to scale deployment, rolling update, restart a pod using a wizard.

Environment:

 

Here is the list of actions which I took to bring the dashboard on localhost and remote node.

Enable the dashboard on Localhost – Minikube

1. Execute the following command to deploy the dashboard in Minikube. I am using mobaxterm to get X11 forwarding enabled to open the browser.

login as: root
     ┌────────────────────────────────────────────────────────────────────┐
     │                        • MobaXterm 10.5 •                          │
     │            (SSH client, X-server and networking tools)             │
     │                                                                    │
     │ ➤ SSH session to root@192.168.3.165                                │
     │   • SSH compression : ✔                                            │
     │   • SSH-browser     : ✔                                            │
     │   • X11-forwarding  : ✔  (remote display is forwarded through SSH) │
     │   • DISPLAY         : ✔  (automatically set on remote server)      │
     │                                                                    │
     │ ➤ For more info, ctrl+click on help or visit our website           │
     └────────────────────────────────────────────────────────────────────┘

Last login: Wed May 22 07:52:09 2019 from 192.168.3.1
[root@kubebase ~]# minikube dashboard
* Enabling dashboard ...
* Verifying dashboard health ...
* Launching proxy ...
* Verifying proxy health ...
* Opening http://127.0.0.1:40612/api/v1/namespaces/kube-system/services/http:kubernetes-dashboard:/proxy/ in your default browser...
xdg-open: no method available for opening 'http://127.0.0.1:40612/api/v1/namespaces/kube-system/services/http:kubernetes-dashboard:/proxy/'
* failed to open browser: exit status 3

 

2. Ensure the GUI packages are installed in your system.

[root@kubebase ~]# yum groupinstall 'X Window System' 'GNOME'
Loaded plugins: fastestmirror
There is no installed groups file.
Maybe run: yum groups mark convert (see man yum)
Loading mirror speeds from cached hostfile
 * base: mirrors.viethosting.com
 * extras: mirrors.viethosting.com
 * updates: mirrors.viethosting.com
Resolving Dependencies
--> Running transaction check
---> Package NetworkManager-libreswan-gnome.x86_64 0:1.2.4-2.el7 will be installed

If you get an error like below during the package installation, Please refer to this article.

Transaction check error:
file /boot/efi/EFI/centos from install of fwupdate-efi-12-5.el7.centos.x86_64 conflicts with file from package grub2-common-1:2.02-0.65 .el7.centos.2.noarch

Error Summary

 

3. Install firefox package to the browser.

[root@kubebase centos]# yum install firefox
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.viethosting.com
 * extras: mirrors.viethosting.com
 * updates: mirrors.viethosting.com
Resolving Dependencies
--> Running transaction check
---> Package firefox.x86_64 0:60.6.1-1.el7.centos will be installed
--> Processing Dependency: redhat-indexhtml for package: firefox-60.6.1-1.el7.centos.x86_64
--> Processing Dependency: mozilla-filesystem for package: firefox-60.6.1-1.el7.centos.x86_64
--> Processing Dependency: liberation-sans-fonts for package: firefox-60.6.1-1.el7.centos.x86_64
--> Processing Dependency: liberation-fonts-common for package: firefox-60.6.1-1.el7.centos.x86_64
--> Running transaction check

 

4. Try to access the Minikube dashboard.

[root@kubebase ~]# minikube dashboard
* Enabling dashboard ...
* Verifying dashboard health ...
* Launching proxy ...
* Verifying proxy health ...
* Opening http://127.0.0.1:41862/api/v1/namespaces/kube-system/services/http:kubernetes-dashboard:/proxy/ in your default browser...
START /usr/bin/firefox "http://127.0.0.1:41862/api/v1/namespaces/kube-system/services/http:kubernetes-dashboard:/proxy/"
Running without a11y support!
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast

I have received the following error while accessing the dashboard.

libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast

 

5. Update the system using “yum update”.

[root@kubebase ~]# yum update
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.viethosting.com
 * extras: mirrors.viethosting.com
 * updates: mirrors.viethosting.com
Resolving Dependencies
--> Running transaction check
---> Package GeoIP.x86_64 0:1.5.0-11.el7 will be updated
---> Package GeoIP.x86_64 0:1.5.0-13.el7 will be an update
---> Package alsa-lib.x86_64 0:1.1.4.1-2.el7 will be updated

 

6. Re-try to access the “Minikube” dashboard.

[root@kubebase ~]# minikube dashboard
* Enabling dashboard ...
* Verifying dashboard health ...
* Launching proxy ...
* Verifying proxy health ...
* Opening http://127.0.0.1:34375/api/v1/namespaces/kube-system/services/http:kubernetes-dashboard:/proxy/ in your default browser...
START /usr/bin/firefox "http://127.0.0.1:34375/api/v1/namespaces/kube-system/services/http:kubernetes-dashboard:/proxy/"
Running without a11y support!

7. Minikube dashboard has been launched successfully using the ssh X11 forwarding.

Image may be NSFW.
Clik here to view.
Enable Kubernetes Dashboard - Minikube
Minikube dashboard

 

How to access the Minikube dashboard remotely using the host IP?

1. Here is the host IP . “virsh” command shows that KVM Minikube is up and running.

[root@kubebase ~]# ip a |grep inet |grep ens33
    inet 192.168.3.165/24 brd 192.168.3.255 scope global noprefixroute dynamic ens33
[root@kubebase ~]#
[root@kubebase ~]#
[root@kubebase ~]# virsh list --all
 Id    Name                           State
----------------------------------------------------
 2     minikube                       running
[root@kubebase ~]#

 

2. Expose the Kube proxy to listen to all the IP. This is valid only for the current SSH session. To make it persistent, add it in startup scripts.

[root@kubebase ~]# kubectl proxy --address='0.0.0.0' --disable-filter=true &
[1] 75827
[root@kubebase ~]#

 

3. Find out the base URL for dashboard access. From the following URL, we need to swap the host URL & Port to access the dashboard.

[root@kubebase ~]# kubectl cluster-info
Kubernetes master is running at https://192.168.39.109:8443
KubeDNS is running at https://192.168.39.109:8443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy

To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
[root@kubebase ~]#

 

4. Here is my URL to access the Minikube dashboard for remote access. “http://192.168.3.165:8001/api/v1/namespaces/kube-system/services/http:kubernetes-dashboard:/proxy/”

Image may be NSFW.
Clik here to view.
Enable Remote - Kubernetes Dashboard - Minikube
Kubernetes Dashboard – Minikube

We have successfully enabled and accessed the Minikube – Kubernetes dashboard.

 

Hope this article is informative to you.  Follow UnixArena on Social media to get regular updates.

The post Kubernetes /Minikube – Enable Dashboard – RHEL 7 / CentOS 7 appeared first on UnixArena.


Viewing all articles
Browse latest Browse all 369

Trending Articles