标签:复制 服务 com raw sed 创建用户 account tps none
1.1创建目录(master-1节点)
[root@master-1 ~]# mkdir /root/dashboard && cd /root/dashboard/
[root@master-1 ~]# kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v1.10.1/src/deploy/recommended/kubernetes-dashboard.yaml
1.2 修改端口
#修改为nodeport端口50000
#注意镜像地址无法下载, 使用另外的镜像替换
mirrorgooglecontainers/kubernetes-dashboard-amd64:v1.10.1
[root@master-1 ~]# sed -i ‘/targetPort:/a\ \ \ \ \ \ nodePort: 50000\n\ \ type: NodePort‘ recommended-2.0.yaml
1.3 部署
[root@master-1 dashboard]# kubectl apply -f recommended-2.0.yaml
1.4查看服务端口
[root@master-1 dashboard]# kubectl get services -n kube-system
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
coredns ClusterIP 10.0.0.2 <none> 53/UDP,53/TCP,9153/TCP 19d
kubelet ClusterIP None <none> 10250/TCP 12d
kubernetes-dashboard NodePort 10.0.0.218 <none> 443:50000/TCP 16s
1.5创建用户授权
[root@master-1 dashboard]# kubectl create serviceaccount dashboard-admin -n kube-system
[root@master-1 dashboard]# kubectl create clusterrolebinding dashboard-admin --clusterrole=cluster-admin --serviceaccount=kube-system:dashboard-admin
1.6获取Token
#获取token
[root@master-1 ~]# kubectl describe secrets -n kube-system $(kubectl -n kube-system get secret | awk ‘/dashboard-admin/{print $1}‘)
1.7 登录系统
#如果之前有安装过其他的版本的dashboard, 那么切换node节点IP访问
1.8 web操作
标签:复制 服务 com raw sed 创建用户 account tps none
原文地址:https://www.cnblogs.com/liangchen4/p/14100132.html