gitpod icon indicating copy to clipboard operation
gitpod copied to clipboard

We might reach the docker pull rate limit when we use individual clusters for preview-environments

Open fullmetalrooster opened this issue 4 years ago • 7 comments

Bug description

During loadtests for our preview-environments on individual VMs we reached the rate limit to pull images from the docker registry [1]. This might happen if the number of developers grow. To prevent this from happening we could use a mirror that caches the docker images. k3s is already capable of using a mirror by setting it up in /etc/rancher/k3s/registries.yaml [2]. We can either create our own registry that might be useful in the future but would block progressing on this topic or we can use an already present public mirror like the one Google offers [3]. Quick tests have show that some images are present to download but others are not. This makes the GCP mirror unreliable and we have to test if does work for the images we want to pull which is not practical.

gitpod /workspace/gitpod (wth/rancher-mirror) $ sudo docker pull mirror.gcr.io/library/ubuntu:xenial
xenial: Pulling from library/ubuntu
58690f9b18fc: Pull complete 
b51569e7c507: Pull complete 
da8ef40b9eca: Pull complete 
fb15d46c38dc: Pull complete 
Digest: sha256:0f71fa8d4d2d4292c3c617fda2b36f6dabe5c8b6e34c3dc5b0d17d4e704bd39c
Status: Downloaded newer image for mirror.gcr.io/library/ubuntu:xenial
mirror.gcr.io/library/ubuntu:xenial
gitpod /workspace/gitpod (wth/rancher-mirror) $ sudo docker pull mirror.gcr.io/library/ubuntu:impish
Error response from daemon: manifest for mirror.gcr.io/library/ubuntu:impish not found: manifest unknown: Failed to fetch "impish" from request "/v2/library/ubuntu/manifests/impish".

Steps to reproduce

  1. Open a new workspace
  2. run sudo docker pull mirror.gcr.io/library/ubuntu:xenial. => download succeeds
  3. run sudo docker pull mirror.gcr.io/library/ubuntu:impish. => download fails

Workspace affected

No response

Expected behavior

We should not run into rate limits during loadtests for preview-environments on individual k3s-clusters.

Example repository

No response

Anything else?

No response

fullmetalrooster avatar Mar 11 '22 10:03 fullmetalrooster

I did another test configuring the registry mirror in the docker daemon config [1] and tested the download of the images same images which does work. So I guess that the image cannot be found on the mirror and therefore has been downloaded directly from the docker hub [2]. This will give us no benefit and we definitively should use our own pull-through cache.

fullmetalrooster avatar Mar 16 '22 14:03 fullmetalrooster

As we already discussed running an own registry on Harvester I suggest that I start working on it. We could install either the docker-registry we already use in Gitpod which is maintained by a private person or we can use harbor as Arthur suggested which has support from bitnami. I am in favor of harbor because of the official support [1].

fullmetalrooster avatar Mar 16 '22 16:03 fullmetalrooster

hi Wulf, in the spirit of an RFC, can you list what requirements the docker registry needs to fulfill and why a registry candidate is the best choice?

meysholdt avatar Mar 17 '22 11:03 meysholdt

I created a small RFC [1]. I can get more into detail about the registries if you want but it is mostly a decision between the old docker-registry we use in already in Gitpod and harbor as a sustainable solution for future expansion and easier management.

fullmetalrooster avatar Mar 17 '22 15:03 fullmetalrooster

This is the same problem https://github.com/gitpod-io/gitpod/issues/8724

fullmetalrooster avatar Apr 04 '22 10:04 fullmetalrooster

I added the blocked label until we have a decision on how to progress (see the RFC for more information).

fullmetalrooster avatar Apr 12 '22 07:04 fullmetalrooster

fixed via https://github.com/gitpod-io/gitpod/pull/9671

meysholdt avatar May 02 '22 09:05 meysholdt