Background
There are 2 ways to configure a private registry on your DKP 2.x cluster.
- First, is through the
--registry
flags available on the DKP CLI, during cluster creation.- This parses the entries into a
konvoy-mirror.toml file
, located in/etc/containerd/conf.d/
- It is then eventually merged into the config.toml as an import, which you would see in the config.toml defined as
imports = ["/etc/containerd/conf.d/*.toml"]
- This parses the entries into a
- Second, is through the use of
overrides
, which takes in a yaml file, containing the defined overrides - https://docs.d2iq.com/dkp/2.3/use-override-files-with-dkp- This can take in multiple overrides in a single file. Ex, offline, nvidia and registry.
- This is parsed directly into the config.toml during the KIB operation, with go templating.
Hint: use the command crictl info
to see the effective config, since looking at the config.toml would not be enough, specially if there are imports.
How to configure multiple registry mirrors and endpoints
There are cases where multiple registry mirrors and/or multiple registry endpoints per mirror, needs to be defined in the config.toml.
For this use case, we have defined the override file as below.
default_image_registry_mirrors:
"docker.io": 'https://harborregistryhost.com/v2/pull-proxy-cache", "https://harborregistryhost.com/v2/dkp-kaptain-images", "https://harborregistryhost.com/v2/konvoy-images", "https://harborregistryhost.com/v2'
"*": 'https://harborregistryhost.com/v2/pull-proxy-cache", "https://harborregistryhost.com/v2/dkp-kaptain-images", "https://harborregistryhost.com/v2/konvoy-images", "https://harborregistryhost.com/v2'
"harborregistryhost.com": "https://harborregistryhost.com/v2"
Take note of how each mirror (docker.io, wildcard) has multiple endpoint. Which is enclosed in a single quote, and are comma separated.
If you need more information on how the config.toml is generated during the KIB operation. You can see the config.toml.tmpl (go template), in the KIB project.