Containerd Private Registry Configuration

Mar 11, 2021

For instance, the URI of private registry: registry.legacy.

Edit /etc/hosts if necessary. After that, create a template configuration file for Containerd.

sudo cp /var/lib/rancher/k3s/agent/etc/containerd/config.toml /var/lib/rancher/k3s/agent/etc/containerd/config.toml.tmpl

Append private registry configuration to the file above.

sudo vim /var/lib/rancher/k3s/agent/etc/containerd/config.toml.tmpl
[plugins.cri.registry.mirrors]
[plugins.cri.registry.mirrors."registry.legacy"]
  endpoint = ["http://registry.legacy"]

Restart k3s.

sudo systemctl restart k3s

[back]