背景说明

Rancher Desktop 没有提供用于管理 Kubernetes 集群的仪表盘。默认情况下,你只能通过 kubectl、helm、nerdctl 管理 Rancher Desktop 创建的 Kubernetes 集群。

解决方案

官方文当

https://docs.rancher.cn/docs/rancherdesktop/features-guide/ui/_index/

下载地址

https://github.com/cnrancher/kube-explorer/releases

部署环境

软部署至自带的rancher-desktop系统中即可
image.png
image.png

软件下载

  1. [root@LAPTOP-CRFFK470 /]# yum install -y wget
  2. [root@LAPTOP-CRFFK470 /]# wget https://github.com/cnrancher/kube-explorer/releases/download/v0.2.8/kube-explorer-linux-amd64 --no-check-certificate
  3. [root@LAPTOP-CRFFK470 /]# chmod +x kube-explorer-linux-amd64
  4. [root@LAPTOP-CRFFK470 /]# cp -a /mnt/c/Users/86183/.kube ~
  5. [root@LAPTOP-CRFFK470 /]# mv kube-explorer-linux-amd64 kube-explorer

软件运行

当本地有多个Kubernetes上下文时通过参数—context进行指定


[root@LAPTOP-CRFFK470 /]# ./kube-explorer --context=rancher-desktop --http-listen-port=9898 --https-listen-port=0

软件访问

本地访问

打开Windows的浏览器访问网址:http://localhost:9898/dashboard/c/local/explorer
image.png

主机访问

由于每次Rancher Desktop重新启动时子系统的IP会发生变化,查看配置文件
image.png
image.png
这里的172.28.249.21即为子系统的IP

公网访问

这里使用花生壳的壳域名方案进行内网穿透,这里的内网主机手动输入子系统IP即可
image.png
访问http://kubernetes.wocp.fun/dashboard/c/local/explorer即可验证
image.png