In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
Today, I will introduce to you how to use the cluster network monitoring tool KubeNurse. The content of the article is good. Now I would like to share it with you. Friends who feel in need can understand it. I hope it will be helpful to you. Let's read it along with the editor's ideas.
Address
Kubenurse: https://github.com/postfinance/kubenurse
Brief introduction
In the operation of a Kubernetes cluster, a common failure is the network failure in the cluster, which often leads to some strange problems due to temporary policy changes or network jitter. In the actual scenario, the monitoring of virtual machines and networks is often managed by other departments. If you start with business and upper-level facilities such as Kubernetes, it may take some time to solve the problem. The kubenurse project uses HTTP detection to provide several commonly used monitoring indicators.
The implementation of this tool is also very straightforward, deployed on each cluster node in the form of Daemonset, and each Pod will access the above targets separately by means of HTTP detection, and finally expose them in the form of Prometheus Summary indicators for monitoring. The detection mechanism is shown in the figure:
Each Pod opens 8080 http ports, including the following endpoints:
/ or / alive:
Return the information of this node
/ alwayshappy:
Return HTTP 200for heartbeat
/ metrics:
Expose Prometheus indicator data
The node information returned by / alive is as follows:
{
"api_server_direct": "ok"
"api_server_dns": "ok"
"me_ingress": "ok"
"me_service": "ok"
"hostname": "kubenurse-1234-x2bwx"
"neighbourhood_state": "ok"
"neighbourhood": [
{
"PodName": "kubenurse-1234-8fh3x"
"PodIP": "10.10.10.67"
"HostIP": "10.12.12.66"
"NodeName": "k8s-66.example.com"
"Phase": "Running"
}
{
"PodName": "kubenurse-1234-ffjbs"
"PodIP": "10.10.10.138"
"HostIP": "10.12.12.89"
"NodeName": "k8s-89.example.com"
"Phase": "Running"
}
]
"headers": {
"Accept": [
"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8"
]
"Accept-Encoding": [
"gzip, deflate, br"
]
...
}
}
As you can see, it contains several test results mentioned above.
Deployment
The source code contains an example directory, which can be deployed simply by kubectl apply. Here are two areas that may need to be modified:
The default namespace is kube-system, so it is recommended to look for replacements and be careful to adjust the RBAC authorization.
Ingress detection is involved, so be careful to provide the correct domain name.
Monitor and control
After the deployment is successful, Prometheus collects data according to the annotations in Daemonset:
...
Annotations:
Prometheus.io/path: "/ metrics"
Prometheus.io/port: "8080"
Prometheus.io/scheme: "http"
Prometheus.io/scrape: "true"
...
If you visit the 8080/metrics endpoint of any Pod, you will see the following metrics:
Kubenurse_errors:
If an error occurs during the detection process, this counter accumulates.
Kubenurse_request:
A Summary type index, the time consumption distribution of normal test results.
These two metrics use type tags to identify the results, corresponding to several different detection targets:
Api_server_direct:
Detect API Server directly from the node
Api_server_dns:
Slave node detects API Server through DNS
Me_ingress:
Detect the Service of this service through Ingress
Me_service:
Use Service to detect the Service of this service
Path_$KUBELET_HOSTNAME:
Mutual detection between nodes
In this way, we can confirm the state of the cluster network based on the distribution of various delay times and the number of errors returned.
Be careful
When there are many nodes, each collection may generate n * (NMUI 1) visits, which will cause a heavy load. You can tag Pod and use tag filtering to reduce requests, but this will lead to the problem that the detection results are not comprehensive enough, so it is necessary to weigh the practical application.
These are all the contents of how to use the cluster network monitoring tool KubeNurse. More about how to use the cluster network monitoring tool KubeNurse can search the previous articles or browse the following articles to learn! I believe the editor will add more knowledge to you. I hope you can support it!
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: 273
*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.