批量把pod实例调成0
#!/bin/bash
namespace=`kubectl get ns|grep '^te-'|grep -v datamgr|awk '{print $1}'`
#---------------------------
for i in $namespace
do
podname=`kubectl get deploy -n $i |awk 'NR>1{if ($2>0) print $1}'`
for j in $podname
do
kubectl scale --replicas=0 deployment/$j -n $i
#echo $i $j >> pod.txt
done
done