Skip to content

Instantly share code, notes, and snippets.

@ethnchao
Last active January 22, 2022 10:33
Show Gist options
  • Save ethnchao/de5e50b1ac554e414f050fa758108ca5 to your computer and use it in GitHub Desktop.
Save ethnchao/de5e50b1ac554e414f050fa758108ca5 to your computer and use it in GitHub Desktop.
Kubernetes k8s.gcr.io images pull & retag & remove
#!/bin/bash
K8S_VERSION=v1.15.0
PAUSE_VERSION=3.1
ETCD_VERSION=3.3.10
COREDNS_VERSION=1.3.1
docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/kube-apiserver:${K8S_VERSION} && \
docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/kube-controller-manager:${K8S_VERSION} && \
docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/kube-scheduler:${K8S_VERSION} && \
docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/kube-proxy:${K8S_VERSION} && \
docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/pause:${PAUSE_VERSION} && \
docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/etcd:${ETCD_VERSION} && \
docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/coredns:${COREDNS_VERSION} && \
docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/kube-apiserver:${K8S_VERSION} k8s.gcr.io/kube-apiserver:${K8S_VERSION} && \
docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/kube-controller-manager:${K8S_VERSION} k8s.gcr.io/kube-controller-manager:${K8S_VERSION} && \
docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/kube-scheduler:${K8S_VERSION} k8s.gcr.io/kube-scheduler:${K8S_VERSION} && \
docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/kube-proxy:${K8S_VERSION} k8s.gcr.io/kube-proxy:${K8S_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/etcd:${ETCD_VERSION} k8s.gcr.io/etcd:${ETCD_VERSION} && \
docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/coredns:${COREDNS_VERSION} k8s.gcr.io/coredns:${COREDNS_VERSION} && \
docker rmi registry.cn-hangzhou.aliyuncs.com/google_containers/kube-apiserver:${K8S_VERSION} && \
docker rmi registry.cn-hangzhou.aliyuncs.com/google_containers/kube-controller-manager:${K8S_VERSION} && \
docker rmi registry.cn-hangzhou.aliyuncs.com/google_containers/kube-scheduler:${K8S_VERSION} && \
docker rmi registry.cn-hangzhou.aliyuncs.com/google_containers/kube-proxy:${K8S_VERSION} && \
docker rmi registry.cn-hangzhou.aliyuncs.com/google_containers/pause:${PAUSE_VERSION} && \
docker rmi registry.cn-hangzhou.aliyuncs.com/google_containers/etcd:${ETCD_VERSION} && \
docker rmi registry.cn-hangzhou.aliyuncs.com/google_containers/coredns:${COREDNS_VERSION}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment