alta3 / kubernetes-the-alta3-way

The greatest k8s installer on the planet!
223 stars 34 forks source link

Create variable and mechanism for setting the default registry #12

Closed bryfry closed 3 years ago

bryfry commented 3 years ago

Due to rate limits imposed by docker hub it has become a useful learning and operational concern to setup the nodes' default container registry to something other than docker.io. Ideally this would be both a combination of a local private registry as well as a public pull-through proxy registry.

Source: https://docs.docker.com/docker-hub/download-rate-limit/

bryfry commented 3 years ago

On each node

edit /etc/containerd/config.toml (full file below)

version = 2

[plugins]
  [plugins."io.containerd.grpc.v1.cri"]
    [plugins."io.containerd.grpc.v1.cri".registry]
      [plugins."io.containerd.grpc.v1.cri".registry.mirrors]
        [plugins."io.containerd.grpc.v1.cri".registry.mirrors."docker.io"]
          endpoint = ["https://registry.alta3.com"]

sudo systemctl restart containerd

Originally posted by @bryfry in https://github.com/alta3/infrastructure/issues/126#issuecomment-762460832

This config file should be pushed out via this playbook. https://registry.alta3.com should be a variable maybe docker_io_mirror_endpoint?