mini-lab icon indicating copy to clipboard operation
mini-lab copied to clipboard

add proxy registries for common registries

Open ostempel opened this issue 8 months ago • 1 comments

Description

Closes https://github.com/metal-stack/mini-lab/issues/210

Added proxy registries of common registries in order to consecutively cache images.

Also tried to start proxy registries before control-plane startup in order to cache default k8s images, but this didn't work.

ostempel avatar Mar 11 '25 13:03 ostempel

Also checked other solutions like nexus and harbor. They require advanced configuration and are too heavyweight for this use-case.

In order to cleanup the registries I tried to find a solutions which supports deleting unused images. Problem here is, that images just support createdAt and no lastUse date. Therefore we now just support static volume size cleanup. Meaning the volume of a proxy gets deleted if it exceeds a specific threshold.

ostempel avatar Mar 17 '25 10:03 ostempel

removed complex logic in favor of native support of cleanup of registry v3. Thank you to @robertvolkmann for research help.

Tested with TTL of 1m.

ostempel avatar May 19 '25 13:05 ostempel

To me it looks good now. Locally, it reduced the provisioning time quite significantly:

# first run
make control-plane  0.75s user 0.65s system 0% cpu 2:50.32 total
# second run
make control-plane  0.84s user 0.57s system 1% cpu 2:16.62 total

I expect it to be even more significant on the self-hosted runners.

I also tried briefly to bring this up without internet connection. The release vector download and Helm chart repositories prevent doing this. For our release vector we can resolve this issue by releasing it as an OCI artifact, too:

  • https://github.com/metal-stack/releases/issues/228
  • https://github.com/metal-stack/ansible-common/issues/33

Gerrit91 avatar May 21 '25 08:05 Gerrit91