k8s怎么查看集群资源使用情况

   2025-02-04 3160
核心提示:要查看Kubernetes集群的资源使用情况,可以使用以下命令:查看集群中所有节点的资源使用情况:kubectl top nodes查看集群中所有P

要查看Kubernetes集群的资源使用情况,可以使用以下命令:

查看集群中所有节点的资源使用情况:

kubectl top nodes

查看集群中所有Pod的资源使用情况:

kubectl top pods

查看集群中指定命名空间的所有Pod的资源使用情况:

kubectl top pods -n <namespace>

查看集群中指定Pod的资源使用情况:

kubectl top pod <pod-name> -n <namespace>

这些命令将显示每个节点或Pod的CPU和内存使用情况。可以使用--sort-by参数对结果进行排序,默认按CPU使用量排序,可以选择排序字段为cpumemory

 
 
更多>同类维修知识
推荐图文
推荐维修知识
点击排行
网站首页  |  关于我们  |  联系方式  |  用户协议  |  隐私政策  |  网站留言