#!/bin/bash images=($(kubeadm config images list)) for image in ${images[*]};do echo -e "\e[7mdownload $image\e[0m" if [[ $image =~ coredns ]];then image_=coredns:${image##*v} echo $image_ $image docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/$image_ docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/$image_ $image docker image rm registry.cn-hangzhou.aliyuncs.com/google_containers/$image_ else image=${image#*/} echo $image docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/$image docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/$image k8s.gcr.io/$image docker image rm registry.cn-hangzhou.aliyuncs.com/google_containers/$image fi done