Kubernetes部署docker Pull镜像脚本

2018年7月18日12:09:57 发表评论 3,982 ℃

#!/bin/bash
# Name: ImagePull.sh
# Description: Kubernetes部署docker Pull镜像脚本
# Author: www.amd5.cn
# Version: 1.0.0
# Datetime: 2017-08-21 14:02:05

set -e
# Check version in https://kubernetes.io/docs/reference/setup-tools/kubeadm/kubeadm-init/
# Search "Running kubeadm without an internet connection"
# For running kubeadm without an internet connection you have to pre-pull the required master images for the version of choice:
KUBE_VERSION=v1.11.0
KUBE_PAUSE_VERSION=3.1
ETCD_VERSION=3.2.18
DNS_VERSION=1.1.3
GCR_URL=k8s.gcr.io
ALIYUN_URL=registry.cn-shenzhen.aliyuncs.com/cookcodeblog
images=(kube-proxy-amd64:${KUBE_VERSION}
kube-scheduler-amd64:${KUBE_VERSION}
kube-controller-manager-amd64:${KUBE_VERSION}
kube-apiserver-amd64:${KUBE_VERSION}
pause-amd64:${KUBE_PAUSE_VERSION}
etcd-amd64:${ETCD_VERSION}
coredns:${DNS_VERSION}
#kubernets1.11.0 已经由coredns替代k8s-dns
#k8s-dns-sidecar-amd64:${DNS_VERSION}
#k8s-dns-kube-dns-amd64:${DNS_VERSION}
#k8s-dns-dnsmasq-nanny-amd64:${DNS_VERSION}
)
for imageName in ${images[@]} ; do
    docker pull $ALIYUN_URL/$imageName
    docker tag  $ALIYUN_URL/$imageName $GCR_URL/$imageName
    docker rmi $ALIYUN_URL/$imageName
done
docker images

【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: