K8s的GUI资源管理之仪表板
//
# kubernetes-dashboard v1.10
dockerHub-仪表板Tags (opens new window)
- 下载docker镜像
docker pull ryan0817/kubernets-dashboard-amd64:v1.10.1
docker tag ryan0817/kubernets-dashboard-amd64:v1.10.1 harbor.yfklife.cn/public/dashboard:v1.10.1
docker push harbor.yfklife.cn/public/dashboard:v1.10.1
1
2
3
2
3
# 获取资源配置清单
cd /opt/application
wget https://download.yfklife.cn/blog/public/kubernetes/kubernetes-dashboard-v1.10.1.zip
unzip kubernetes-dashboard-v1.10.1.zip && cd kubernetes-dashboard
#创建应用
kubectl apply -f 0-rbac-dashboard-admin.yaml
kubectl apply -f 0-secret-dashboard.yaml
kubectl apply -f 1-deployment-dashboard.yaml
kubectl apply -f 1-service-dashboard.yaml
kubectl apply -f ingress-dashboard.yaml
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
# 配置nginx,secrets令牌登录
- 配置nginx,和ssl证书,监听443端口,且重载nginx,配置DNS域名解析
vi /etc/nginx/sites-enabled/dashboard.yfklife.cn.conf
server {
listen 80;
server_name dashboard.yfklife.cn;
rewrite ^(.*)$ http://${server_name}$1 permanent;
}
server {
listen 443 ssl;
server_name dashboard.yfklife.cn;
ssl_certificate ssl/dashboard.yfklife.cn.crt;
ssl_certificate_key ssl/dashboard.yfklife.cn.key;
ssl_session_timeout 10m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5:!EXPORT56:!EXP;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
location / {
proxy_pass http://backend_traefik;
proxy_set_header Host $http_host;
proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for;
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
说明
1.node计算节点【192.168.14.21,192.168.14.22】
2.nginx这里的proxy_pass 对应的是之前配置的主域名里的upstream "backend_traefik"
3.当访问http://dashboard.yfklife.cn 的时候强制跳转走https,路由通过nginx代理到traefik做的路由匹配,访问到对应的service
4.我这里的资源创建在 kube-system 空间名下
- 获取secrets 令牌,登录
kubectl describe secrets -n kube-system kubernetes-dashboard-admin-token
- 登录进来的界面
权限
kubectl explain ClusterRoleBinding.subjects.kind
# dashboard-heapster插件
heapster插件Github地址 (opens new window)
- 下载docker镜像,打tag,上传到私有仓库
docker pull quay.io/bitnami/heapster:1.5.4
docker tag c359b95ad38b harbor.yfklife.cn/public/heapster:v1.5.4
docker push harbor.yfklife.cn/public/heapster:v1.5.4
1
2
3
4
2
3
4
- 创建应用
#上面拉起下来的"kubernetes-dashboard-v1.10.1.zip"
cd /opt/application/kubernetes-dashboard/heapster
#创建应用
kubectl apply -f rbac.yaml
kubectl apply -f dp.yaml
kubectl apply -f service.yaml
1
2
3
4
5
6
7
2
3
4
5
6
7
- 检查
# 个人存储下载地址。。。
wget https://download.yfklife.cn/blog/public/kubernetes/kubernetes-dashboard-v1.10.1.zip
1
//
如果此文章对您有帮助,点击 -->> 请博主喝咖啡 (opens new window)
上次更新: 2023/11/20, 16:23:11