mini-lab
mini-lab copied to clipboard
add proxy registries for common registries
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.
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.
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.
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