This article, any image and yaml I use will send a link to the online disk for you to download and learn!
Links: https://pan.baidu.com/s/1inmW... Password: 92ua
github: https://github.com/heyangguang
You can contact me directly if you have any questions: heyangev@cn.ibm.com
Heapster is a collector that summarizes the data of C advisor on each Node and then exports it to a third-party tool (such as InfluxDB).
About Heapster
Architecture diagram:
Heapster first obtains the information of all nodes in the cluster from the K8S Master, and then obtains the useful data through the kubelet on these nodes, while the data of kubelet itself is obtained from the C advisor. All acquired data is pushed into the backend storage of the heapster configuration, and data visualization is also supported. Now back-end storage + visualization methods, such as InfluxDB + grafana.
Deployment implementation:
Download the heapster image and upload the heapster.yaml and heapster mod.yaml files to apply.
k8smaster: [root@k8smaster ~]# docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/heapster-amd64:v1.5.4 Trying to pull repository registry.cn-hangzhou.aliyuncs.com/google_containers/heapster-amd64 ... v1.5.4: Pulling from registry.cn-hangzhou.aliyuncs.com/google_containers/heapster-amd64 91380601464e: Pull complete f351486260ed: Pull complete Digest: sha256:c4a8d9c0007abb73a1b9e4f9c8bfb044e475aae2b4e6276ab2f8b13959cf6949 Status: Downloaded newer image for registry.cn-hangzhou.aliyuncs.com/google_containers/heapster-amd64:v1.5.4 [root@k8smaster ~]# ls anaconda-ks.cfg heapster-mod.yaml heapster.yaml images.tar kube-flannel.yml [root@k8smaster ~]# kubectl apply -f heapster.yaml serviceaccount/heapster created clusterrolebinding.rbac.authorization.k8s.io/heapster created deployment.apps/heapster created service/heapster created [root@k8smaster ~]# kubectl apply -f heapster-mod.yaml Warning: kubectl apply should be used on resource created by either kubectl create --save-config or kubectl apply clusterrole.rbac.authorization.k8s.io/system:heapster configured //View status: [root@k8smaster ~]# kubectl get pods -n kube-system NAME READY STATUS RESTARTS AGE coredns-86c58d9df4-kmfct 1/1 Running 0 23m coredns-86c58d9df4-qn2k2 1/1 Running 0 23m etcd-k8smaster 1/1 Running 0 23m heapster-569b679494-rktzf 1/1 Running 0 18s kube-apiserver-k8smaster 1/1 Running 1 22m kube-controller-manager-k8smaster 1/1 Running 0 22m kube-flannel-ds-amd64-9rmfz 1/1 Running 0 19m kube-flannel-ds-amd64-vnwtf 1/1 Running 0 15m kube-flannel-ds-amd64-x7q4s 1/1 Running 0 15m kube-proxy-7zl9n 1/1 Running 0 22m kube-proxy-t2sx9 1/1 Running 0 23m kube-proxy-txsfr 1/1 Running 0 22m kube-scheduler-k8smaster 1/1 Running 0 23m //Later, use kubectl top node to view the cluster status: [root@k8smaster ~]# kubectl top node NAME CPU(cores) CPU% MEMORY(bytes) MEMORY% k8smaster 122m 3% 2848Mi 8% k8snode-1 27m 0% 603Mi 1% k8snode-2 26m 0% 582Mi 1%
Here is the tutorial of heapster collecting cluster data!
I hope you can point out the problems for me and let's move forward together!
Thank you!