系列目录html
因为一些缘由,在国内没法访问gcr.io上的镜像,在安装kubernetes时,不少官方镜像又是都存在gcr.io上,在国内的一些教程中大都使用阿里云的镜像,可是因为阿里云镜像地址更换等缘由,当按照文档使用阿里云镜像时可能已经变得不可用.下面结合实际经验,列举出几种经常使用的办法来解决这个问题linux
mirrorgooglecontainers
这个域名下同步了不少谷歌镜像,好比说要下载kube-proxy-amd64:v1.11.3
这个镜像,能够使用docker pull mirrorgooglecontainers/kube-proxy-amd64:v1.11.3
来进行下载,下载之后对镜像从新打标签:git
docker tag docker.io/mirrorgooglecontainers/kube-proxy-amd64:v1.11.3 k8s.gcr.io/kube-proxy-amd64:v1.11.3
项目地址: https://github.com/zhangguanzhang/gcr.iogithub
[centos@k8s-master tekton]$ curl -s https://zhangguanzhang.github.io/bash/pull.sh | bash -s search gcr.io cloud-builders cloud-datalab cloudsql-docker distroless google-appengine google-samples google_containers google_samples heptio-images istio-release k8s-minikube kaniko-project knative-releases knative-samples kubeflow-images-public kubernetes-e2e-test-images kubernetes-helm linkerd-io runconduit spinnaker-marketplace tf-on-k8s-dogfood
[centos@k8s-master tekton]$ curl -s https://zhangguanzhang.github.io/bash/pull.sh | bash -s search gcr.io/google_containers addon-builder addon-resizer-amd64 addon-resizer-arm addon-resizer-arm64 addon-resizer-ppc64le addon-resizer-s390x addon-resizer aggregator alpine-iptables-amd64 alpine-iptables-arm alpine-iptables-arm64 alpine-with-bash apparmor-loader busybox cadvisor cassandra-e2e-test cassandra check-metadata-concealment cloud-controller-manager-amd64 cloud-controller-manager-arm cloud-controller-manager-arm64 cloud-controller-manager-ppc64le cloud-controller-manager-s390x cloud-controller-manager cloudsql-authenticator cluster-autoscaler cluster-proportional-autoscaler-amd64 cluster-proportional-autoscaler-arm cluster-proportional-autoscaler-arm64 cluster-proportional-autoscaler-ppc64le clusterapi-tester clusterregistry conformance-amd64 conformance-arm conformance-arm64 conformance-ppc64le conformance-s390x conformance coredns ...
[centos@k8s-master tekton]$ curl -s https://zhangguanzhang.github.io/bash/pull.sh | bash -s search gcr.io/google_containers/coredns 1.0.1 1.0.1__amd64_linux 1.0.1__arm64_linux 1.0.1__arm_linux 1.0.1__ppc64le_linux 1.0.1__s390x_linux 1.0.6 1.0.6__amd64_linux 1.0.6__arm64_linux 1.0.6__arm_linux 1.0.6__ppc64le_linux 1.0.6__s390x_linux 1.1.3 1.1.3__amd64_linux 1.1.3__arm64_linux 1.1.3__arm_linux 1.1.3__ppc64le_linux 1.1.3__s390x_linux 1.2.2 1.2.3 1.2.4 1.2.6 1.3.0 1.3.1
curl -s https://zhangguanzhang.github.io/bash/pull.sh | bash -s -- gcr.io/google_containers/kube-apiserver-amd64:v1.11.3
以上搜索的时候,若是仅指定了
gcr.io
则搜索下面全部的名称空间,若是指定的名称空间,则搜索指定名称空间下的全部镜像,若是指定了镜像,则搜索镜像的全部版本信息sql
使用search命令的时候,若是没有安装jq则会提示安装jq.jq在centos下安装方法:docker
yum install epel-release
yum list jq
yum install jq