kubernetes dashboard 1.7.1 部署

kubernetes dashboard 1.7.1 部署

摘要

kubernetes dashboard 1.7.1 部署

从03开始看


01 服务器上下载 
docker pull gcr.io/google_containers/kubernetes-dashboard-init-amd64:v1.0.0
docker pull gcr.io/google_containers/kubernetes-dashboard-amd64:v1.7.1


02 打包镜像 
image=gcr.io/google_containers/kubernetes-dashboard-init-amd64:v1.0.0 && docker save ${image} > ${image////@}.tar
image=gcr.io/google_containers/kubernetes-dashboard-amd64:v1.7.1 && docker save ${image} > ${image////@}.tar


03 下载到k8s (master node都执行)
wget https://files.javablog.net/k8s/all-k8s-images/gcr.io@google_containers@kubernetes-dashboard-init-amd64:v1.0.0.tar
wget https://files.javablog.net/k8s/all-k8s-images/gcr.io@google_containers@kubernetes-dashboard-amd64:v1.7.1.tar


04 还原image  (master node都执行)
image=gcr.io@google_containers@kubernetes-dashboard-init-amd64:v1.0.0.tar && docker load < ${image} 
image=gcr.io@google_containers@kubernetes-dashboard-amd64:v1.7.1.tar && docker load < ${image}

05 创建dashboard (master)
kubectl delete -f https://raw.githubusercontent.com/kubernetes/dashboard/v1.7.1/src/deploy/recommended/kubernetes-dashboard.yaml
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v1.7.1/src/deploy/recommended/kubernetes-dashboard.yaml


06 在本地访问 kubernetes dashboard

master上执行
kubectl create -f https://files.javablog.net/k8s/kube/dashboard-admin.yml

本机执行( win不方便执行命令,当然也可以选择NodePort模式 )
scp root@<master ip>:/etc/kubernetes/admin.conf .
kubectl --kubeconfig ./admin.conf proxy

本机浏览器访问
http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/

参考链接

https://github.com/kubernetes/dashboard
https://github.com/kubernetes/dashboard/wiki/Accessing-Dashboard---1.7.X-and-above
https://github.com/kubernetes/dashboard/wiki/Access-control