#!/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
原文地址:https://www.cnblogs.com/fan-gx/p/12037256.html
时间: 2024-10-29 05:22:22