Kubernetes1.15部署Dashboard

发布时间:2020-07-13 06:47:22 作者:无锋剑
来源:网络 阅读:2130

=== master节点上进行如下操作 ===

部署方法1-原生文件部署:

kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v1.10.1/src/deploy/recommended/kubernetes-dashboard.yaml

默认使用端口:8001
默认镜像下载地址:google

部署方法2-修改镜像端口和镜像地址方法

1.创建Dashboard的yaml文件

wget https://raw.githubusercontent.com/kubernetes/dashboard/v1.10.1/src/deploy/recommended/kubernetes-dashboard.yaml

修改镜像

sed -i 's/k8s.gcr.io/国内可访问镜像地址/g' kubernetes-dashboard.yaml

修改端口

sed -i '/targetPort:/a\ \ \ \ \ \ nodePort: 50001\n\ \ type: NodePort' kubernetes-dashboard.yaml

本地执行部署Dashboard

kubectl create -f kubernetes-dashboard.yaml

检查相关服务运行状态

kubectl get deployment kubernetes-dashboard -n kube-system

kubectl get pods -n kube-system -o wide

kubectl get services -n kube-system

netstat -ntlp|grep 50001

浏览器访问

浏览器输入Dashboard访问地址:https://172.20.101.252:50001

创建访问用户和授权

kubectl create serviceaccount  dashboard-admin -n kube-system
kubectl create clusterrolebinding  dashboard-admin --clusterrole=cluster-admin --serviceaccount=kube-system:dashboard-admin

查看访问Dashboard的认证令牌

[root@kubm-01 ~]# kubectl describe secrets -n kube-system $(kubectl -n kube-system get secret | awk '/dashboard-admin/{print $1}')
Name:         dashboard-admin-token-x5qt8
Namespace:    kube-system
Labels:       <none>
Annotations:  kubernetes.io/service-account.name: dashboard-admin
              kubernetes.io/service-account.uid: 24900572-5faf-4ea5-b343-829517f5b871

Type:  kubernetes.io/service-account-token

Data
====
ca.crt:     1025 bytes
namespace:  11 bytes
token:      eyJhbGciOiJSUzI1NiIsImtpZCI6IiJ9.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJrdWJlLXN5c3RlbSIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjcmV0Lm5hbWUiOiJkYXNoYm9hcmQtYWRtaW4tdG9rZW4teDVxdDgiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC5uYW1lIjoiZGFzaGJvYXJkLWFkbWluIiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZXJ2aWNlLWFjY291bnQudWlkIjoiMjQ5MDA1NzItNWZhZi00ZWE1LWIzNDMtODI5NTE3ZjViODcxIiwic3ViIjoic3lzdGVtOnNlcnZpY2VhY2NvdW50Omt1YmUtc3lzdGVtOmRhc2hib2FyZC1hZG1pbiJ9.vvLlroVjuZ42m5E4ywT_vPLElfUPN67R0xu4GcbomTNyzjYic6SCsNxo-I-uIRuVtSu-O-cv2ECdLeshApzsZEc9Wr23XTdb8lHT3yHvXuT3o7SRPl74YxUcxRvW19H7O4RMQ4Y5Mu4j-W4QAsS7Y6yMphLijre60qlaE5-yDwm0VnXBg59AbVlIaTnya8VChp7sEHXNPORcdqvonMVojkJitH8567AD1mxb94m1eL3OU8CrN_UHZhWLvU27VSzdwCL6SIwUi8iy18uOvH-3_HFJs93Wt48LwfgDD0xNioDdkDiO7qr9qbpttNUWCXKnfpY3Jyk0UreBtP8VHUBJwg

输入token

Kubernetes1.15部署Dashboard

点击登录

项目地址

https://github.com/kubernetes/dashboard

推荐阅读:
  1. kubernetes怎么安装部署Dashboard
  2. kubernetes部署DashBoard的步骤

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

kubernetes 1.15 部署

上一篇:开启web前端工作模式

下一篇:关于客户端与服务端时区不同导致客户端上的时间不准问题的解决方案

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》