查看K8S业务中的CPU是否超限

#!/bin/sh

pods=`kubectl get pods -n prod |grep $1|awk '{print \$1}'`

for pod in $pods
do
    echo $pod;
    kubectl exec -it --tty -n prod $pod -- cat /sys/fs/cgroup/cpu,cpuacct/cpu.stat
    echo -e "\n"
done

 

posted @ 2021-11-29 09:57  缺个好听的昵称  阅读(153)  评论(0编辑  收藏  举报