#!/bin/bash images=( k8s.gcr.io/pause:3.1=registry.cn-hangzhou.aliyuncs.com/google_containers/pause-amd64:3.1 gcr.io/google_containers/defaultbackend:1.4=registry.cn-hangzhou.aliyuncs.com/google_containers/defaultbackend:1.4 k8s.gcr.io/kubernetes-dashboard-amd64:v1.10.1=registry.cn-hangzhou.aliyuncs.com/google_containers/kubernetes-dashboard-amd64:v1.10.1 k8s.gcr.io/heapster-influxdb-amd64:v1.3.3=registry.cn-hangzhou.aliyuncs.com/google_containers/heapster-influxdb-amd64:v1.3.3 k8s.gcr.io/heapster-amd64:v1.5.2=registry.cn-hangzhou.aliyuncs.com/google_containers/heapster-amd64:v1.5.2 k8s.gcr.io/heapster-grafana-amd64:v4.4.3=registry.cn-hangzhou.aliyuncs.com/google_containers/heapster-grafana-amd64:v4.4.3 k8s.gcr.io/metrics-server/metrics-server:v0.5.0=registry.cn-hangzhou.aliyuncs.com/google_containers/metrics-server:v0.5.0 ) OIFS=$IFS; # 保存旧值 for image in ${images[@]};do IFS='=' set $image microk8s.ctr image pull $2 microk8s.ctr image tag $2 $1 microk8s.ctr image rm $2 IFS=$OIFS; # 还原旧值 done