Skip to content

shixinghong/repimage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

repimage

很多镜像都在国外。国内下载很慢,需要加速,每次都要手动修改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架构下的镜像替换,如果需要可以自行编译打包是使用

License

Apache-2.0

特别感谢

  • DaoCloud免费提供的镜像代理服务

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published