【学习随手记】kubeadm 查看创建集群需要的镜像版本,附拉取镜像脚本
查看创建集群需要的镜像版本
kubeadm config images list [--kubernetes-version <version>]
国内拉取镜像脚本
一般而言,直接使用kubeadm拉取指定仓库地址是可以的
kubeadm config images pull --image-repository registry.aliyuncs.com/google_containers --kubernetes-version v1.18.3
下面这种是我没找到自动拉取时写的,下列脚本与以上不同的地方在于修改了镜像tag ??
#!/bin/bash # Script For Quick Pull K8S Docker Images # by Hellxz Zhang <> # please run kubeadm for get version msg. e.g `kubeadm config images list --kubernetes-version v1.18.3` # then modified the Version‘s ENV, Saved and Run. KUBE_VERSION=v1.18.3 PAUSE_VERSION=3.2 CORE_DNS_VERSION=1.6.7 ETCD_VERSION=3.4.3-0 # pull aliyuncs mirror docker images docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/kube-proxy:$KUBE_VERSION docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/kube-controller-manager:$KUBE_VERSION docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/kube-apiserver:$KUBE_VERSION docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/kube-scheduler:$KUBE_VERSION docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/pause:$PAUSE_VERSION docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/coredns:$CORE_DNS_VERSION docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/etcd:$ETCD_VERSION # retag to k8s.gcr.io prefix docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/kube-proxy:$KUBE_VERSION k8s.gcr.io/kube-proxy:$KUBE_VERSION docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/kube-controller-manager:$KUBE_VERSION k8s.gcr.io/kube-controller-manager:$KUBE_VERSION docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/kube-apiserver:$KUBE_VERSION k8s.gcr.io/kube-apiserver:$KUBE_VERSION docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/kube-scheduler:$KUBE_VERSION k8s.gcr.io/kube-scheduler:$KUBE_VERSION docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/pause:$PAUSE_VERSION k8s.gcr.io/pause:$PAUSE_VERSION docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/coredns:$CORE_DNS_VERSION k8s.gcr.io/coredns:$CORE_DNS_VERSION docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/etcd:$ETCD_VERSION k8s.gcr.io/etcd:$ETCD_VERSION # untag origin tag, the images won‘t be delete. docker rmi registry.cn-hangzhou.aliyuncs.com/google_containers/kube-proxy:$KUBE_VERSION docker rmi registry.cn-hangzhou.aliyuncs.com/google_containers/kube-controller-manager:$KUBE_VERSION docker rmi registry.cn-hangzhou.aliyuncs.com/google_containers/kube-apiserver:$KUBE_VERSION docker rmi registry.cn-hangzhou.aliyuncs.com/google_containers/kube-scheduler:$KUBE_VERSION docker rmi registry.cn-hangzhou.aliyuncs.com/google_containers/pause:$PAUSE_VERSION docker rmi registry.cn-hangzhou.aliyuncs.com/google_containers/coredns:$CORE_DNS_VERSION docker rmi registry.cn-hangzhou.aliyuncs.com/google_containers/etcd:$ETCD_VERSION
某些比较新的版本可能会没有,阿里云更新比较慢,可以去hub.docker.com去搜下图的用户上传的使用
相关推荐
89427412 2020-04-22
levysnail 2013-03-19
wty00 2013-01-07
阿织的学习笔记 2019-06-21
vincent 2011-06-21
源码在手 2012-11-10
源码在手 2012-11-07
源码佳人 2012-11-04
androidty 2012-11-03
Lucianoesu 2012-10-18
tihi 2012-10-03
yangfangjit 2012-08-23
凉白开 2012-08-15
面向工资编程 2018-05-18
无端端的歉意 2018-03-12
小饭桌 2018-03-08
人人都是产品经理 2018-02-08
UncleLeslie的看法 2018-01-17