阿汤博客-承接中小企业服务器维护和网站维护,有意者可以联系博主!

Kubernetes部署docker Pull镜像脚本

运维维护 117℃ 0评论

#!/bin/bash

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

转载请注明:阿汤博客 » Kubernetes部署docker Pull镜像脚本

喜欢 (0)or分享 (0)