一、在master01上操作(基于之前的多节点环境基础)
1.1、创建dashborad工作目录
[root@master01 k8s]# mkdir dashboard
[root@master01 k8s]# cd dashboard/
[root@master01 dashboard]# rz
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/12c7af4d56d69f828f1412550b689a79.jpeg#pic_center)
1.2、创建资源
[root@master01 dashboard]# kubectl create -f dashboard-rbac.yaml
[root@master01 dashboard]# kubectl create -f dashboard-secret.yaml
[root@master01 dashboard]# kubectl create -f dashboard-configmap.yaml
[root@master01 dashboard]# kubectl create -f dashboard-controller.yaml
[root@master01 dashboard]# kubectl create -f dashboard-service.yaml
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/771616d9a55e40c65ef4a9b47bca3d02.jpeg#pic_center)
[root@master01 dashboard]# kubectl get pods -n kube-system
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/2e2aa61e134769376dce4a2918962731.jpeg#pic_center)
[root@master01 dashboard]# kubectl create -f k8s-admin.yaml #生成令牌
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/4ca200e7526f338d8efc92bc901ba603.jpeg#pic_center)
[root@master01 dashboard]# kubectl get secret -n kube-system
[root@master01 dashboard]# kubectl describe secret dashboard-admin-token-kpq5b -n kube-system #查看令牌
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/aa48d28e6e80e0e3b3d9d82a2151c9f0.jpeg#pic_center)
1.3、登录
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/571238edb4a7e997985e59794e3adfa0.jpeg#pic_center)
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/a7c84335e1d795151cb7e51bf02e16bb.jpeg#pic_center)