安装插件:
CentOS7
shellyum install -y epel-release yum install -y sshpass
UBUNTU
shellapt-get install sshpass
在每个服务器进行docker pull:
shell#!/bin/bash
set -e
HOST_PASSWORD=r00tme
IMAGE_NAME_LIST=("192.168.50.179:80/ai_algorithm_kevink8s/fire_smoke_detect:V1.0" "192.168.50.179:80/ai_algorithm_kevink8s/smoking_detect:V1.0" "192.168.50.179:80/ai_algorithm_kevink8s/electronic_fence_test:V1.10" "192.168.50.179:80/ai_algorithm_kevink8s/eletric_fence_detect:V1.0")
K8SIP_LIST=("192.168.50.173" "192.168.50.174" "192.168.50.175" "192.168.50.176" "192.168.50.177" "192.168.50.178")
for varip in ${K8SIP_LIST[@]};
do
for varimage in ${IMAGE_NAME_LIST[@]};
do
sshpass -p ${HOST_PASSWORD} ssh -tt root@${varip} << EOF
docker pull ${varimage}
# exit
exit 0 # 退出远程连接
EOF
echo "finished";
done
done
本文作者:Dong
本文链接:
版权声明:本博客所有文章除特别声明外,均采用 CC BY-NC。本作品采用《知识共享署名-非商业性使用 4.0 国际许可协议》进行许可。您可以在非商业用途下自由转载和修改,但必须注明出处并提供原作者链接。 许可协议。转载请注明出处!