【CKA模拟题】查询消耗CPU最多的Pod

题干

For this question, please set this context (In exam, diff cluster name)

对于此问题,请设置此上下文(在考试中,diff 集群名称)

bash 复制代码
kubectl config use-context kubernetes-admin@kubernetes

Find the pod that consumes the most CPU in all namespace(including kube-system) in all cluster(currently we have single cluster). Then, store the result in the file high_cpu_pod.txt with the following format: pod_name,namespace .

在所有集群(当前我们只有一个集群)中,在所有命名空间(包括kube-system)中,找到消耗CPU最多的pod,然后将结果以如下格式存储到文件high_cpu_pod.txt中:pod_name,namespace。

解题思路

  1. 切换K8S集群环境
bash 复制代码
kubectl config use-context kubernetes-admin@kubernetes
  1. 通过kubectl top命令根据CPU排序查询
bash 复制代码
top pod -A --sort-by=cpu | awk -F ' ' '{print $2,$1}' | head -n 2 > high_cpu_pod.txt
相关推荐
新手小白*6 天前
Kubernetes 运维实战:etcd 备份恢复、集群升级与证书更新
k8s
百锦再6 天前
【无标题】
服务器·ai·k8s·京东云·core·net·云鼎
新手小白*8 天前
K8s-Calico 网络组件
k8s
运维栈记8 天前
CKA题目分享-第八篇-StatefulSets与Headless Services
kubernetes·cka
运维栈记8 天前
CKA题目分享-第七篇-Gateway API与Pod Admission
kubernetes·cka
幽弥千月12 天前
k8s离线环境下部署【calico】网络插件
k8s
中杯可乐多加冰12 天前
深度解析openFuyao核心组件:从NUMA亲和调度看云原生算力释放新思路
华为·云原生·k8s·gpu算力·openfuyao
科技D人生12 天前
Kubernetes 学习总结(47)—— Kubernetes 持久化存储之 Volume、PV、PVC、StorageClass 到底怎么用?
云原生·容器·kubernetes·k8s·k8s 数据卷
新手小白*13 天前
Kubernetes 持久化存储与特殊容器
k8s
退役小学生呀15 天前
二十六、K8s集群备份恢复
linux·云原生·容器·kubernetes·k8s