1,下载推荐配置

wget  https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0/aio/deploy/recommended.yaml

2,修改recommended.yaml

svc以Nodeport形式暴露出来

3,部署

kubectl create -f recommended.yaml

 4,查看资源

kubectl get pod,svc -n kubernetes-dashboard -o wide

 5,创建账户,获取访问token

kubectl create serviceaccount dashboard-admin -n kubernetes-dashboard

6,授权

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

7,查看token

kubectl get secrets -n kubernetes-dashboard | grep dashboard-admin

 

 

kubectl describe secrets dashboard-admin-token-k9npv -n kubernetes-dashboard

8,访问

https://192.168.199.100:30009/#/login

选token

 如果chrome报连接问题的话,用edge试试。另外要允许cookies

Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐