We'd like to configure a pull-through cache for containerd, so that any images that are pulled by containerd/cri, are pulled through a local registry. This way the image can be cached for multiple Kubernetes nodes in the local registry.
With docker, we can configure this with --registry-mirror=<uri> and all image pulls are done through the URI specified.
See Docker documentation on how to configure the pull-through cache - https://docs.docker.com/registry/recipes/mirror/
With containerd/cri, we can only configure a registry mirror per host, like so:
[plugins.cri.registry.mirrors]
[plugins.cri.registry.mirrors."docker.io"]
endpoint = ["<uri>"]
This would require us to determine all of the possible hosts that we pull from and list them in the containerd config, with our local registry as the endpoint.
I believe #351 isn't properly solved, as --registry-mirror in Docker is able to catch all image pulls and pass them through the local registry.
Ideally we could update the image pull registry logic to allow wildcard hosts, like so:
[plugins.cri.registry.mirrors]
[plugins.cri.registry.mirrors."*"]
endpoint = ["<uri>"]
Thoughts?