单个空间
kubectl -n test-system get deployments -owide |awk '{print $7}' |grep registry.test.cn > images.txt
tail images.txt
所有空间
kubectl get deployments -A -owide |awk '{print $8}' |grep registry.test.cn > images.txt
grep -i bit images.txt |head -n3
sed -i -e "s/,fluent\/fluent-bit:1.*$/ /g" -e "s/,registry.test.cn.*fluent-bit:1.*$/ /g" -e "s/^registry.test.cn.*fluent-bit:1.9,/ /g" images.txt
echo $?
# cat docker.sh
#!/bin/sh
ping registry.test.cn -c2
for i in `cat images.txt`
do
echo $i
docker $1 $i
if [ $? -ne 0 ]
then
echo $i
echo
fi
done
标签:推送,cn,echo,test,txt,registry,images,镜像,k8s From: https://www.cnblogs.com/BillyLV/p/17762967.html