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

你可能感兴趣的:(linux,服务器,运维)