kubectl 如何查看 node、pod 的 cpu、ram使用率

kubectltop命令用于显示Kubernetes集群中节点和Pod的CPU及内存使用情况。它依赖于正确配置和运行的MetricsServer。用户可以使用kubectltopnode查看节点资源使用,或者用kubectltoppod结合筛选条件来查看特定Pod的资源消耗详情。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

简介

╰─➤  kubectl top --help     
Display Resource (CPU/Memory) usage.

 The top command allows you to see the resource consumption for nodes or pods.

 This command requires Metrics Server to be correctly configured and working on the server.

Available Commands:
  node          Display resource (CPU/memory) usage of nodes
  pod           Display resource (CPU/memory) usage of pods

Usage:
  kubectl top [flags] [options]

Use "kubectl <command> --help" for more information about a given command.
Use "kubectl options" for a list of global command-line options (applies to all commands).

查看node

/ # kubectl  top node
NAME                    CPU(cores)   CPU%   MEMORY(bytes)   MEMORY%
devops-prod-master-1    3210m        6%     33845Mi         69%
devops-prod-master-2    2617m        5%     19375Mi         40%
devops-prod-master-3    2472m        31%    11755Mi         75%

查看pod

/ # kubectl top pod -A | grep cv-console-dev | grep rds
cv-console-dev                     cv-console-rds-6b97c64d87-v8djz                                   36m          522Mi
cv-console-dev                     cv-console-web-rds-77cc5d94fd-fwr2q                               1m           25Mi
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

liuyunshengsir

微信:lys20191020

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值