2021-07-16

关于k8s安装dashboard的一点记录

1、kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.1.0/aio/deploy/recommended.yaml

2021-07-16 2、查看得到如图的pod和service即可

2021-07-16 

 3、暴露端口:

kubectl patch svc kubernetes-dashboard -n kubernetes-dashboard -p '{"spec":{"type":"NodePort","ports":[{"port":443,"targetPort":8443,"nodePort":30001}]}}'

2021-07-16

暴露30001端口后即可访问,记得是https请求。

2021-07-16

 

 4、获取token:

a、kubectl create serviceaccount dashboard-admin -n kubernetes-dashboard 创建账户

b、kubectl create clusterrolebinding dashboard-admin-rb --clusterrole=cluster-admin --serviceaccount=kubernetes-dashboard:dashboard-admin

c、kubectl get secrets -n kubernetes-dashboard | grep dashboard-admin 得出如下

2021-07-16

d、kubectl describe secret dashboard-admin-token-pmkh7(上一步得出tocken名) -n kubernetes-dashboard 

tocken即为登录所用tocken。

2021-07-16

 ***关于k8s环境搭建可以读 wenjiajun 的此文章实属不错**

https://www.cnblogs.com/processing/p/14865209.html

上一篇:容器集群k8s从入门到精通之DashBoard(第十章)


下一篇:Helm的使用(部署dashboard仪表盘)