简体   繁体   中英

kube-api server high cpu

I want to know how I can check why one of my ctrl node and kube.netes consumes more cpu than the others.

I have a cluster with 3 ctrl nodes and 4 worker nodes.

I have an nginx load balancer with the least_conn algorithm to distribute the requests to the ctrl nodes.

Monitoring the resources with the top command, I observe that of the three ctrl nodes, the kube api server process always in the first ctrl node gives me a cpu usage above 100%, unlike the other ctrl nodes where the kube-api server uses less than 20%.

I want to know why?

And how can I see that same representation of consumption, be it pod, containers. nodes in grafana

After finding what happens in your cluster using kubctl top node and kubectl top pod , you can further diagnose what is happening with kubectl logs $pod -c $container on the pod.

At this point, it is up to the container to provide information on what it is doing, so ideally, you would collect metrics in the pods to get a quick insight into what is happening on your cluster using eg Grafana. You can also have a look at the resources assigned to your pod using kubectl get pod $pod -o jsonpath='{.spec.containers[].resources}' .

In your case, the log messages of the kube.netes apiserver should give you a hint. Probably, something (another container/pod maybe) is clogging up your API server.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM