很多镜像都在国外。国内下载很慢,需要加速,每次都要手动修改yaml文件中的镜像地址,很麻烦。这个项目就是为了解决这个问题。
用于替换k8s中一些在国内无法访问的镜像地址,替换的镜像地址在 public-image-mirror 中查看
git clone https://github.com/shixinghong/repimage.git
cd repimage
kubectl apply -f yaml/webhook.yaml ## 一定要先安装webhook的服务 ready之后再安装admission
kubectl apply -f yaml/admission.yaml
kubectl delete -f yaml/webhook.yaml -f yaml/admission.yaml
自动替换yaml文件中的镜像地址,例如:
k8s.gcr.io/coredns/coredns => m.daocloud.io/k8s.gcr.io/coredns/coredns
nginx => m.daocloud.io/docker.io/library/nginx
- 只有在 public-image-mirror 中的地址才会被替换,否则不会被替换
- 替换的方式是增加前缀方式,不是替换方式
- 目前只支持在amd64架构下的镜像替换,如果需要可以自行编译打包是使用
Apache-2.0
- DaoCloud免费提供的镜像代理服务