Skip to content

Instantly share code, notes, and snippets.

@Zsyhuy
Zsyhuy / pull_k8s.sh
Created February 18, 2021 13:04
从国内镜像站拉取k8s所需镜像,并重命名
#!/bin/bash
images_list=`kubeadm config images list`
mirrors_url='registry.cn-hangzhou.aliyuncs.com/google_containers'
for need_image in $images_list; do
down_image="$mirrors_url/${need_image##*/}"
docker pull $down_image
docker tag $down_image $need_image
docker rmi $down_image