Kubernetes - Kubernetes详解;安装部署_MinggeQingchun的博客-CSDN博客
https://blog.csdn.net/MinggeQingchun/article/details/126420188
Kubernetes Dashbaord(Kubernetes仪表盘)是Kubernetes集群的基于Web的通用UI,它允许用户管理群集中运行的应用程序并对其进行故障排除,以及管理群集本身
GitHub - kubernetes/dashboard: General-purpose web UI for Kubernetes clusters
Kubernetes Dashbaord安装参考文章
安装Kubernetes Dashboard | Kuboard
wget https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.4/aio/deploy/recommended.yaml
修改kubernetes-dashboard namespace中的svc kubernetes-dashboard 的spec.type为NodePort,便于我们从集群外使用浏览器访问dashboard
service段配置更改如下:(nodePort: 30001可以省略,缺省则为随机端口,服务启动后使用kubectl get svc -n kubernetes-dashboard查看)
- spec:
- type: NodePort
- ports:
- - port: 443
- targetPort: 8443
- nodePort: 30001
kubectl apply -f recommended.yaml
或者直接一步到位:
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.4/aio/deploy/recommended.yaml
kubectl get pod -n kubernetes-dashboard
5、浏览器输入访问
此时报错
需要使用https访问
https://192.168.133.129:30001/
需要输入token,token的生成采用下面的三条固定命令
- kubectl create serviceaccount dashboard-admin -n kube-system
-
- kubectl create clusterrolebinding dashboard-admin --clusterrole=cluster-admin --serviceaccount=kube-system:dashboard-admin
-
- kubectl describe secrets -n kube-system $(kubectl -n kube-system get secret | awk '/dashboard-admin/{print $1}')
即可得到 token
输入token进入,页面如下