Skip to content
This repository was archived by the owner on Mar 9, 2022. It is now read-only.
This repository was archived by the owner on Mar 9, 2022. It is now read-only.

Add support for pull-through cache with registry #1196

@awprice

Description

@awprice

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions