手记

Setup Kubernetes dashboard

Setup the service

docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/kubernetes-dashboard-amd64:v1.8.3docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/kubernetes-dashboard-amd64:v1.8.3 k8s.gcr.io/kubernetes-dashboard-amd64:v1.8.3git clone https://github.com/kubernetes/dashboardkubectl apply -f  ./src/deploy/recommended/kubernetes-dashboard.yaml

Make the service accessible

kubectl -n kube-system edit svc/kubernetes-dashboard

Change .spec.type to NodePort. And then use kubectl -n kube-system get svc/kubernetes-dashboard
to get the external port number of dashboard. Then use https://<Kube Master IP>:<port>/ to access the dashboard.

Get Tokens for cluster admin

kubectl -n kube-system get secret|grep admin-token
kubectl -n kube-system get secret admin-token-<your id> -o jsonpath={.data.token}|base64 -d

Get Tokens for default namespace

kubectl create rolebinding default-admin --clusterrole=admin --serviceaccount=default:default --namespace=defaultkubectl get secret | grep default-token
kubectl get secret default-token-<your id> -o jsonpath={.data.token}|base64 -d



作者:frameyl
链接:https://www.jianshu.com/p/d2f97824453e


0人推荐
随时随地看视频
慕课网APP