K8s镜像

来自linux中国网wiki
Evan讨论 | 贡献2019年12月27日 (五) 07:38的版本 →‎evan
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳到导航 跳到搜索

evan2010

k8s.gcr.io 国内镜像拉不下来的办法

[root@master tomcat]# docker images 
REPOSITORY                           TAG                 IMAGE ID            CREATED             SIZE

calico/kube-controllers              v3.7.4              e67ede28cc7e        2 weeks ago         46.8MB
k8s.gcr.io/kube-proxy                v1.15.0             d235b23c3570        3 weeks ago         82.4MB
k8s.gcr.io/kube-apiserver            v1.15.0             201c7a840312        3 weeks ago         207MB
k8s.gcr.io/kube-controller-manager   v1.15.0             8328bb49b652        3 weeks ago         159MB
k8s.gcr.io/kube-scheduler            v1.15.0             2d3813851e87        3 weeks ago         81.1MB

quay.io/coreos/flannel               v0.11.0-amd64       ff281650a721        5 months ago        52.6MB
k8s.gcr.io/coredns                   1.3.1               eb516548c180        6 months ago        40.3MB
k8s.gcr.io/etcd                      3.3.10              2c4adeb21b4f        7 months ago        258MB
k8s.gcr.io/pause                     3.1                 da86e6ba6ca1        19 months ago       742kB

calico/node                          v3.7.4              84b65b552a8f        2 weeks ago         155MB
calico/cni                           v3.7.4              203668d151b2        2 weeks ago         135MB
gcr.io/kubernetes-helm/tiller        v2.14.1             ac22eb1f780e        5 weeks ago         94.2MB

2. 从Registry中拉取镜像
$ sudo docker pull registry.cn-shenzhen.aliyuncs.com/evan886/k8s:[镜像版本号]
3. 将镜像推送到Registry
$ sudo docker login --username=linuxsa886 registry.cn-shenzhen.aliyuncs.com
$ sudo docker tag [ImageId] registry.cn-shenzhen.aliyuncs.com/evan886/k8s:[镜像版本号]
$ sudo docker push registry.cn-shenzhen.aliyuncs.com/evan886/k8s:[镜像版本号]
sudo docker push registry.cn-shenzhen.aliyuncs.com/evan886/k8s:debian_tomcatv1

kubectl v1.15.0

sudo docker tag e67ede28cc7e   registry.cn-shenzhen.aliyuncs.com/evan886/k8s:kube-controllers
sudo docker tag d235b23c3570 registry.cn-shenzhen.aliyuncs.com/evan886/k8s:kube-proxy
sudo docker tag 201c7a840312  registry.cn-shenzhen.aliyuncs.com/evan886/k8s:kube-apiserver
sudo docker tag 8328bb49b652 registry.cn-shenzhen.aliyuncs.com/evan886/k8s:kube-controller-manager  
sudo docker tag 2d3813851e87 registry.cn-shenzhen.aliyuncs.com/evan886/k8s:kube-scheduler
sudo docker tag ff281650a721 registry.cn-shenzhen.aliyuncs.com/evan886/k8s:flannel  
sudo docker tag eb516548c180 registry.cn-shenzhen.aliyuncs.com/evan886/k8s:coredns
sudo docker tag 2c4adeb21b4f registry.cn-shenzhen.aliyuncs.com/evan886/k8s:etcd
sudo docker tag da86e6ba6ca1 registry.cn-shenzhen.aliyuncs.com/evan886/k8s:pause 
sudo docker tag  registry.cn-shenzhen.aliyuncs.com/evan886/k8s:
sudo docker tag  registry.cn-shenzhen.aliyuncs.com/evan886/k8s:


#push 
sudo docker push  registry.cn-shenzhen.aliyuncs.com/evan886/k8s:kube-controllers
sudo docker push registry.cn-shenzhen.aliyuncs.com/evan886/k8s:kube-proxy
sudo docker push registry.cn-shenzhen.aliyuncs.com/evan886/k8s:kube-apiserver
sudo docker push registry.cn-shenzhen.aliyuncs.com/evan886/k8s:kube-controller-manager  
sudo docker push  registry.cn-shenzhen.aliyuncs.com/evan886/k8s:kube-scheduler
sudo docker push registry.cn-shenzhen.aliyuncs.com/evan886/k8s:flannel  
sudo docker push registry.cn-shenzhen.aliyuncs.com/evan886/k8s:coredns
sudo docker push 2c4adeb21b4f registry.cn-shenzhen.aliyuncs.com/evan886/k8s:etcd
sudo docker push da86e6ba6ca1 registry.cn-shenzhen.aliyuncs.com/evan886/k8s:pause 



kubect 有好多用法 
  cp             复制 files 和 directories 到 containers 和从容器中复制 files 和

useage

pull到所以节点

#pull
sudo docker pull  registry.cn-shenzhen.aliyuncs.com/evan886/k8s:kube-controllers
sudo docker pull registry.cn-shenzhen.aliyuncs.com/evan886/k8s:kube-proxy
sudo docker pull registry.cn-shenzhen.aliyuncs.com/evan886/k8s:kube-apiserver
sudo docker pull registry.cn-shenzhen.aliyuncs.com/evan886/k8s:kube-controller-manager  
sudo docker pull  registry.cn-shenzhen.aliyuncs.com/evan886/k8s:kube-scheduler
sudo docker pull registry.cn-shenzhen.aliyuncs.com/evan886/k8s:flannel  
sudo docker pull registry.cn-shenzhen.aliyuncs.com/evan886/k8s:coredns
sudo docker pull 2c4adeb21b4f registry.cn-shenzhen.aliyuncs.com/evan886/k8s:etcd
sudo docker pull da86e6ba6ca1 registry.cn-shenzhen.aliyuncs.com/evan886/k8s:pause 

改tag为gcri

docker tag  registry.cn-shenzhen.aliyuncs.com/evan886/k8s:kube-controllers calico/kube-controllers:v3.7.4 
...

导出完全离线

docker save -o kube-proxy.tar k8s.gcr.io/kube-proxy:v1.15.0