返回顶部

gpu/cpu类型deployment清单整理脚本

#!/bin/bash

kubectl get deploy -n host | grep -v '  0  ' | awk '{print $1}' > deploy.txt

for deploy in `cat deploy.txt`
do
  check_gpu=`kubectl describe deploy -n host $deploy | grep "tencent.com/vcuda-core" | wc -l`
  if [ $check_gpu = 0 ];
  then
    echo $deploy >> deploy_cpu.txt
  else
    echo $deploy >> deploy_gpu.txt
  fi
done
posted @ 2022-10-21 10:26  丨君丶陌  阅读(38)  评论(0编辑  收藏  举报