在我以docker模式启动k8s的时候,报错了 镜像拉不下来。
解决的思路如下:
假设我们需要拉取的镜像是 gcr.io/kubernetes-helm/tiller:v2.14.3
- 首先搜索一下哪些源提供了你需要拉的镜像:
#列:
docker search tiller
# NAME DESCRIPTION STARS OFFICIAL AUTOMATED
# jessestuart/tiller Nightly multi-architecture (amd64, arm64, ar… 12 [OK]
# sapcc/tiller Mirror of https://gcr.io/kubernetes-helm/til… 8
# ist0ne/tiller https://gcr.io/kubernetes-helm/tiller 3 [OK]
# rancher/tiller 2
# jmgao1983/tiller from gcr.io/kubernetes-helm/tiller 2 [OK]
# ibmcom/tiller Docker Image for IBM Cloud private-CE (Commu… 1
# itinerisltd/tiller 1
# luxas/tiller 1
# ansibleplaybookbundle/tiller-apb An APB that deploys tiller for use with helm. 0 [OK]
# cfplatformeng/tiller 0
# cfplatformeng/tiller-ubuntu 0
# ibmcom/tiller-ppc64le Docker Image for IBM Cloud Private-CE (Commu… 0
# kubeapps/tiller-proxy A web-based UI for deploying and managing ap… 0
# kubeapps/tiller-proxy-ci Store temporary images generated by CI system 0
# sorenmat/tiller 0
# appscode/tiller 0
# cgetzen/tiller Custom Tiller Tests 0
# fkpwolf/tiller 0
# anjia0532/tiller 0
# pcanham/tiller tiller image for Raspberry Pi for testing He… 0
# itinerisltd/tiller-circleci 0
# kontenapharos/tiller 0
# 4admin2root/tiller gcr.io/kubernetes-helm/tiller 0 [OK]
# renaultdigital/tillerless-helm-gcloud Add tillerless plugin to helm-gcloud image 0
# wzrdtales/tillerless-helm tillerless-helm 0
从结果可以看出 sapcc/tiller
是缓存 gcr.io/kubernetes-helm 的镜像,我们去docker.hub 上面去搜索一下 sapcc/tiller
,验证一下源信息:
发现版本信息也吻合,那直接将地址换成该第三方的即可:
docker pull sapcc/tiller:v2.14.3
以下是一些常用的 k8s 国内可用的镜像地址:
#这三条语句是等效的
docker pull k8s.gcr.io/kube-apiserver:v1.15.2
docker pull gcr.azk8s.cn/google-containers/kube-apiserver:v1.15.2
docker pull registry.cn-hangzhou.aliyuncs.com/dck8s/kube-apiserver:v1.15.2
拉好之后可以查看本地镜像:
docker images
再通过以下命令 把来下来的镜像修改成 k8s.gcr.io
域名下的:
docker tag gcr.azk8s.cn/google-containers/kube-apiserver:v1.15.2 k8s.gcr.io/kube-apiserver:v1.15.2
这就相当于把从别的服务上,把镜像已经拉到本地了。
网友评论