Skip to content

Instantly share code, notes, and snippets.

@k8scat
Created April 18, 2021 15:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save k8scat/0414c6661c5e211b6327cd77fcd864c6 to your computer and use it in GitHub Desktop.
Save k8scat/0414c6661c5e211b6327cd77fcd864c6 to your computer and use it in GitHub Desktop.
Pull K8S images - v1.21.0
#!/bin/bash
#
# Pull K8S images
# Version: 1.21.0
# Maintainer: k8scat@gmail.com
set -e
# Pull images from aliyun registry
kubeadm config images list | sed -e 's/^/docker pull /g' -e 's#k8s.gcr.io#registry.cn-shenzhen.aliyuncs.com/k8scat#g' -e 's#/coredns/coredns#/coredns#g' | sh -x
# Tag images
docker images | grep k8scat | awk '{print "docker tag",$1":"$2,$1":"$2}' | sed -e 's#registry.cn-shenzhen.aliyuncs.com/k8scat#k8s.gcr.io#2' | sh -x
docker tag k8s.gcr.io/coredns:v1.8.0 k8s.gcr.io/coredns/coredns:v1.8.0
# Remove images
docker images | grep k8scat | awk '{print "docker rmi",$1":"$2}' | sh -x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment