kubesphere / kubekey

Install Kubernetes/K3s only, both Kubernetes/K3s and KubeSphere, and related cloud-native add-ons, it supports all-in-one, multi-node, and HA 🔥 ⎈ 🐳
https://kubesphere.io
Apache License 2.0
2.18k stars 518 forks source link

kk supports mirror warehouse configuration, not just for dockerhub warehouse #2296

Open snail2sky opened 6 days ago

snail2sky commented 6 days ago

Your current KubeKey version

kk version: &version.Info{Major:"3", Minor:"1", GitVersion:"v3.1.1", GitCommit:"7a184f786b02bec20d5534af137896f50e510396", GitTreeState:"clean", BuildDate:"2024-04-16T04:28:43Z", GoVersion:"go1.19.2", Compiler:"gc", Platform:"linux/amd64"}

Describe this feature

Currently kk can create a mirror for the dockerhub image when initializing the cluster. After the creation is completed, it is found that the mirror has indeed been added to the containerd configuration file, but it seems that it cannot add mirrors for other mirror sites, such as quay.io and other public site

Describe the solution you'd like

registry:
  registryMirrors:
    docker.io:
    - https://docker.mirror-demo.com
    - https://docker.mirror-demo1.com
    - http://docker.mirror-demo2.com
    quay.io:
    - https://quay.mirror-demo.com
    - http://quay.mirror-demo1.com

In order to ensure backward compatibility, you can also do this

registry:
  registryMirrors: []
  otherRegistryMirrors:
    quay.io:
    - https://quay.mirror-demo.com
    - http://quay.mirror-demo1.com
    gcr.io:
    - https://gcr.m.daocloud.io

Additional information

In this case, you can directly configure the image and other things during initialization. KK has done a very good job, and I hope it can do better.