k8s镜像下载,打标签,删除的.sh文件

  • Post author:
  • Post category:其他


1.下载k8s镜像:

#!/bin/bash
sudo docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/kube-controller-manager:v1.17.3
sudo docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/kube-scheduler:v1.17.3
sudo docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/kube-proxy:v1.17.3
sudo docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/pause:3.1
sudo docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/etcd:3.4.3-0
sudo docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/coredns:1.6.5
sudo docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/kube-apiserver:v1.17.3

2.打标签:

#!/bin/bash
sudo docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/kube-apiserver:v1.17.3 k8s.gcr.io/kube-apiserver:v1.17.3
sudo docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/kube-controller-manager:v1.17.3 k8s.gcr.io/kube-controller-manager:v1.17.3
sudo docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/kube-scheduler:v1.17.3 k8s.gcr.io/kube-scheduler:v1.17.3
sudo docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/kube-proxy:v1.17.3 k8s.gcr.io/kube-proxy:v1.17.3
sudo docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/pause:3.1 k8s.gcr.io/pause:3.1
sudo docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/etcd:3.4.3-0 k8s.gcr.io/etcd:3.4.3-0
sudo docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/coredns:1.6.5 k8s.gcr.io/coredns:1.6.5

3.删除多余镜像

#!/bin/bash
sudo docker rmi -f registry.cn-hangzhou.aliyuncs.com/google_containers/kube-proxy:v1.17.3
sudo docker rmi -f registry.cn-hangzhou.aliyuncs.com/google_containers/kube-apiserver:v1.17.3
sudo docker rmi -f registry.cn-hangzhou.aliyuncs.com/google_containers/kube-controller-manager:v1.17.3
sudo docker rmi -f registry.cn-hangzhou.aliyuncs.com/google_containers/kube-scheduler:v1.17.3
sudo docker rmi -f registry.cn-hangzhou.aliyuncs.com/google_containers/coredns:1.6.5
sudo docker rmi -f registry.cn-hangzhou.aliyuncs.com/google_containers/etcd:3.4.3-0
sudo docker rmi -f registry.cn-hangzhou.aliyuncs.com/google_containers/pause:3.1



版权声明:本文为qq_45875747原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。