In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Heapster is already deprecated: https://github.com/kubernetes/heapster, so the following demonstration is mainly aimed at the version of Kubernetes before 1.10. I have a new version here, so I can't collect data.
1. Introduction of Heapster
Heapster is a container cluster monitoring and performance analysis tool that naturally supports Kubernetes and CoreOS.
Kubernetes has a famous surveillance agent-cAdvisor. CAdvisor is run on each kubernetes Node, and it collects monitoring data (cpu,memory,filesystem,network,uptime) for both the native and the container. In newer versions, K8S has integrated cAdvisor functionality into kubelet components. Each Node node can be implemented directly.
Web access.
Heapster is a collector. Heapster can collect cAdvisor data on Node nodes, summarize the data of cAdvisor on each Node, and aggregate resources according to the resource type of kubernetes, such as Pod and Namespace, and obtain their CPU, memory, network and disk metric respectively. The default metric data aggregation interval is 1 minute. You can also import data into third-party tools such as InfluxDB.
The monitoring chart information for Kubernetes native dashboard comes from heapster. Heapster,HPA is also used in Horizontal Pod Autoscaling to use Heapster as a Resource Metrics API to get metric from it.
Architecture diagram
Heapster first gets information about all the Node in the cluster from apiserver, and then obtains useful data through the kubelet on these Node, while the data of kubelet itself is obtained from cAdvisor. All acquired data is pushed to the back-end storage of the Heapster configuration, and data visualization is also supported. Now the backend stores + visualization methods, such as InfluxDB + grafana.
II. Deployment
Heapster itself is a Kubernetes application, and the deployment method is very simple. Run the following command:
[root@master ~] # git clone https://github.com/kubernetes/heapster.git[root@master ~] # kubectl apply-f heapster/deploy/kube-config/influxdb/deployment.extensions/monitoring-grafana createdservice/monitoring-grafana createdserviceaccount/heapster createddeployment.extensions/heapster createdservice/heapster createddeployment.extensions/monitoring-influxdb createdservice/monitoring-influxdb created [root@master ~] # kubectl apply-f heapster/deploy/kube-config/rbac/heapster-rbac.yamlclusterrolebinding.rbac.authorization.k8s.io/heapster created
For well-known reasons, we can only obtain some images indirectly because we can't download them. Let's look for them in Aliyun's warehouse.
Docker pull registry.cn-hangzhou.aliyuncs.com/k8s_grc_io/heapster-amd64:v1.5.4docker tag registry.cn-hangzhou.aliyuncs.com/k8s_grc_io/heapster-amd64:v1.5.4 k8s.gcr.io/heapster-amd64:v1.5.4docker image rm registry.cn-hangzhou.aliyuncs.com/k8s_grc_io/heapster-amd64:v1.5.4docker pull registry.cn-hangzhou.aliyuncs.com/k8s-kernelsky/heapster-grafana-amd64:v5.0. 4docker tag registry.cn-hangzhou.aliyuncs.com/k8s-kernelsky/heapster-grafana-amd64:v5.0.4 k8s.gcr.io/heapster-grafana-amd64:v5.0.4docker image rm registry.cn-hangzhou.aliyuncs.com/k8s-kernelsky/heapster-grafana-amd64:v5.0.4docker pull registry.cn-hangzhou.aliyuncs.com/k8s-images1/heapster-influxdb-amd64:v1.5.2docker tag registry.cn-hangzhou.aliyuncs.com/k8s-images1/heapster-influxdb-amd64:v1. 5.2 k8s.gcr.io/heapster-influxdb-amd64:v1.5.2docker image rm registry.cn-hangzhou.aliyuncs.com/k8s-images1/heapster-influxdb-amd64:v1.5.2
Resources related to Heapster are as follows:
[root@master ~] # kubectl get pod-n kube-system | grep-e heapster- e monitorheapster-f64999bc-8x7j7 1 + 1 Running 0 16mmonitoring-grafana-564f579fd4-jsx2r 1 + 1 Running 0 16mmonitoring-influxdb-8b7d57f5c-ntnxc 1 + + 1 Running 0 16m [root@master ~] # kubectl get deploy-n kube-system | grep-e heapster- e monitorheapster 1 grep 11 1 16mmonitoring-grafana 1 16mmonitoring-influxdb 1 1 16mmonitoring-influxdb 1 11 16m [root@master] # kubectl get svc-n kube-system | grep-e heapster-e monitorheapster ClusterIP 10.101.170.222 80/TCP 16mmonitoring-grafana ClusterIP 10. 104.60.71 80/TCP 16mmonitoring-influxdb ClusterIP 10.104.104.41 8086/TCP 16m
For convenience and access, you can change the type of Service monitoring-grafana to NodePort through kubectl edit.
[root@master ~] # kubectl patch svc monitoring-grafana-p'{"spec": {"type": "NodePort"}'- n kube-systemservice/monitoring-grafana patched
At present, our Pod heapster cannot collect data, because it has been abandoned, you can view the error message through the following command.
Kubectl logs heapster-f64999bc-8x7j7-n kube-system III. Use
The browser opens the Web UI: http://MASTER_IP:32314/ of Grafana
Heapster has pre-configured DataSource and Dashboard for Grafana.
Heapster's predefined Dashboard is intuitive and simple. If necessary, you can define your own Dashboard in Grafana to meet specific business needs.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.