1.执行文件
kubectl apply -f https://gitee.com/fffqqql/k8s/blob/master/recommended.yaml
kubectl apply -f https://gitee.com/fffqqql/k8s/blob/master/dashboard-sa.yaml
kubectl apply -f https://gitee.com/fffqqql/k8s/blob/master/dashboard-clusterrolebinding.yaml
2.修改dashboard的外网访问端口(nodePort模式)
kubectl -n kubernetes-dashboard patch svc kubernetes-dashboard -p '{"spec":{"type":"NodePort"}}'
3.获取token
kubectl describe secret -n kubernetes-dashboard $(kubectl get secret -n kubernetes-dashboard | grep dashboard-admin | awk '{print $1}')
4.查看dashboard 端口
kubectl get svc --all-namespaces
图片.png
5.访问dashboard(由于证书问题,请暂时用firefox访问)
https://192.168.0.104:32201/
图片.png
图片.png
图片.png
6.输入token,看到如下界面
图片.png
网友评论