kubernetes之监控heapster安装使用
一、容器资源需求、资源限制
资源需求、资源限制:指的是cpu、内存等资源;
资源需求、资源限制的两个关键字:
- request:需求,最低保障,在调度时,这个节点必须要满足request需求的资源大小;
- limits:限制、硬限制。这个限制容器无论怎么运行都不会超过limits的值;
CPU:k8s的一个cpu对应一颗宿主机逻辑cpu。一个逻辑cpu还可以划分为1000个毫核(millcores)。所以1cpu=1000m;500m=0.5个CPU,0.5m相当于二分之一的核心;
内存的计量单位:E、P、T、G、M、K
heapster
HeapSter的作用是收集个节点pod的资源使用情况,然后以图形界面展示给用户。
1.部署influxdb:
wget https://raw.githubusercontent.com/kubernetes-retired/heapster/master/deploy/kube-config/influxdb/influxdb.yaml
修改镜像地址为 ccr.ccs.tencentyun.com/cl0411/heapster-influxdb-amd64:v1.5.2
2.部署rbac
kubectl apply -f https://raw.githubusercontent.com/kubernetes-retired/heapster/master/deploy/kube-config/rbac/heapster-rbac.yaml
3. 部署heapster
wget https://raw.githubusercontent.com/kubernetes-retired/heapster/master/deploy/kube-config/influxdb/heapster.yaml
修改镜像地址为 ccr.ccs.tencentyun.com/cl0411/heapster-amd64:v1.5.4
4.部署Grafana
wget https://raw.githubusercontent.com/kubernetes-retired/heapster/master/deploy/kube-config/influxdb/grafana.yaml
修改镜像地址为 ccr.ccs.tencentyun.com/cl0411/heapster-grafana:v5.0.4
type: NodePort #为了能在集群外部访问Grafana,所以我们需要定义NodePort
自此heapster部署完成,如何使用,可能还需要进一步学习influxbd、grafana等;
kubernetes之监控heapster安装使用
http://www.jcwit.com/article/39/