部署Dashborad以及监控组件Heaperster教程
2018-09-26 本文已影响0人
Firetheworld
续上一篇《部署K8SV1.11.0+CalicoV3.13集群》后,我们开始进行Dashborad以及监控组件Heaperster的部署。
- 节点以及环境如下
IP | Role | Hostname |
---|---|---|
10.18.223.243 | Master | k8s-node10-18-223-243 |
10.18.223.244 | Worker | k8s-node10-18-223-243 |
10.18.223.244 | Worker | k8s-node10-18-223-243 |
工作节点标记为禁止调度: kubectl cordon Hostname
取消调度:kubectl uncordon Hostname
将Dashborad以及监控组件Heaperster部署在Matser上,因此部署前,需要将其他工作节点标记为unschedulabled(不可调度),因为在部署的过程中,服务器是随机进行调度部署在其他地方上。
- 对工作节点调度结果如下:
调度前
[root@k8s-node10-18-223-243 images]# kubectl get nodes
NAME STATUS ROLES AGE VERSION
k8s-node10-18-223-243 Ready master 2d v1.11.0
k8s-node10-18-223-244 Ready <none> 2d v1.11.0
k8s-node10-18-223-245 Ready <none> 2d v1.11.0
调度后
[root@k8s-node10-18-223-243 images]# kubectl cordon k8s-node10-18-223-244
node/k8s-node10-18-223-244 cordoned
[root@k8s-node10-18-223-243 images]# kubectl cordon k8s-node10-18-223-245
node/k8s-node10-18-223-245 cordoned
[root@k8s-node10-18-223-243 images]# kubectl get nodes
NAME STATUS ROLES AGE VERSION
k8s-node10-18-223-243 Ready master 2d v1.11.0
k8s-node10-18-223-244 Ready,SchedulingDisabled <none> 2d v1.11.0
k8s-node10-18-223-245 Ready,SchedulingDisabled <none> 2d v1.11.0
部署前yaml文件以及images准备:
[root@k8s-node10-18-223-243 dashboard]# ll
total 173980
-rw-r--r-- 1 root root 102800384 Jul 4 11:22 dashboard.tar
-rw-r--r-- 1 root root 1437 Aug 3 14:27 heapster-controller.yaml
-rw-r--r-- 1 root root 75337216 Jul 4 17:41 heapster.tar
-rw-r--r-- 1 root root 3640 Aug 3 14:26 kubernetes-dashboard.yaml
- 修改 yaml 文件中的 Dashboard Service以及Heaperster。
[root@k8s-node10-18-223-243 dashboard]# cat heapster-controller.yaml |grep 243
kubernetes.io/hostname: k8s-node10-18-223-243
[root@k8s-node10-18-223-243 dashboard]# cat kubernetes-dashboard.yaml |grep 243
kubernetes.io/hostname: k8s-node10-18-223-243
启动 Dashboard
[root@k8s-node10-18-223-243 dashboard]# kubectl apply -f kubernetes-dashboard.yaml
secret/kubernetes-dashboard-certs created
serviceaccount/kubernetes-dashboard created
clusterrolebinding.rbac.authorization.k8s.io/kubernetes-dashboard created
deployment.apps/kubernetes-dashboard created
service/kubernetes-dashboard created
启动 Heaperster
[root@k8s-node10-18-223-243 dashboard]# kubectl apply -f heapster-controller.yaml
serviceaccount/heapster created
clusterrolebinding.rbac.authorization.k8s.io/heapster created
deployment.extensions/heapster created
service/heapster created
Dashboard界面显示以及Heaperster
到此,Dashborad以及监控组件Heaperster已经安装完毕。