kubernetes k8s,没有关于CPU和内存的信息

ecr0jaav  于 2023-06-28  发布在  Kubernetes
关注(0)|答案(1)|浏览(175)

bounty还有3天到期。此问题的答案有资格获得+50声望奖励。JIST希望引起更多关注这个问题。

当我在iguazio/mlrun解决方案中使用igztop检查运行的pod时,我得到了CPU和内存的空值。请参见此pod *m6vd9的输出中的第一行:

[ jist @ iguazio-system 07:41:43 ]->(0) ~ $ igztop -s cpu
+--------------------------------------------------------------+--------+------------+-----------+---------+-------------+-------------+
| NAME                                                         | CPU(m) | MEMORY(Mi) | NODE      | STATUS  | MLRun Proj. | MLRun Owner |
+--------------------------------------------------------------+--------+------------+-----------+---------+-------------+-------------+
| xxxxxxxxxxxxxxxx7445dfc774-m6vd9                             |        |            | k8s-node3 | Running |             |             |
| xxxxxx-jupyter-55b565cc78-7bjfn                              | 27     | 480        | k8s-node1 | Running |             |             |
| nuclio-xxxxxxxxxxxxxxxxxxxxxxxxxx-756fcb7f74-h6ttk           | 15     | 246        | k8s-node3 | Running |             |             |
| mlrun-db-7bc6bcf796-64nz7                                    | 13     | 717        | k8s-node2 | Running |             |             |
| xxxx-jupyter-c4cccdbd8-slhlx                                 | 10     | 79         | k8s-node1 | Running |             |             |
| v3io-webapi-scj4h                                            | 8      | 1817       | k8s-node2 | Running |             |             |
| v3io-webapi-56g4d                                            | 8      | 1827       | k8s-node1 | Running |             |             |
| spark-worker-8d877878c-ts2t7                                 | 8      | 431        | k8s-node1 | Running |             |             |
| provazio-controller-644f5784bf-htcdk                         | 8      | 34         | k8s-node1 | Running |             |             |

并且在Grafana中也无法查看此Pod的性能指标(CPU、内存、I/O)。
你知道,我如何解决这个问题,而不整个节点重新启动(和什么是根本原因)?

whlutmcx

whlutmcx1#

以下故障排除步骤将帮助您解决问题:
1.使用describe命令检查是否可以看到Pod的CPU和内存:

kubectl describe pods my-pod

2.检查是否可以使用以下命令查看所有Pod和节点的CPU和内存:

kubectl top pod 

kubectl top node

3.使用以下命令检查指标服务器是否正在运行:

kubectl get apiservices v1beta1.metrics.k8s.io
kubectl get pod -n kube-system -l k8s-app=metrics-server

4.使用以下查询检查Pod的CPU和内存:
每个Pod的CPU利用率:

sum(irate(container_cpu_usage_seconds_total{container!="POD", container=~".+"}[2m])) by (pod)

每个Pod的RAM使用量:

sum(container_memory_usage_bytes{container!="POD", container=~".+"}) by (pod)

5.检查pod和节点的日志,如果发现任何错误,请附上这些日志,以便进一步排除故障。

相关问题