安装步骤:
-
点击进入dashboard 的 GitHub - kubernetes/dashboard: General-purpose web UI for Kubernetes clustershttps://github.com/kubernetes/dashboard
-
查看当前k8s版本对应的dashboard版本,点击右边releases
-
执行对应版本指令安装(我的k8s是v1.23)
执行下方指令安装: kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.5.1/aio/deploy/recommended.yaml
安装报错信息:
The connection to the server raw.githubusercontent.com was refused - did you specify the right host or port?
解决办法:
-
直接浏览器打开上述指令中的地址
https://raw.githubusercontent.com/kubernetes/dashboard/v2.5.1/aio/deploy/recommended.yaml 打开后其实是一个文本信息
- 本地创建相同文件,复制浏览器中打开的内容
vi recommended.yaml
- 执行下面指令重新安装
kubectl apply -f recommended.yaml
- 出现下面信息,即问题解决
namespace/kubernetes-dashboard created serviceaccount/kubernetes-dashboard created service/kubernetes-dashboard created secret/kubernetes-dashboard-certs created secret/kubernetes-dashboard-csrf created secret/kubernetes-dashboard-key-holder created configmap/kubernetes-dashboard-settings created role.rbac.authorization.k8s.io/kubernetes-dashboard created clusterrole.rbac.authorization.k8s.io/kubernetes-dashboard created rolebinding.rbac.authorization.k8s.io/kubernetes-dashboard created clusterrolebinding.rbac.authorization.k8s.io/kubernetes-dashboard created deployment.apps/kubernetes-dashboard created service/dashboard-metrics-scraper created deployment.apps/dashboard-metrics-scraper created