- Notifications
You must be signed in to change notification settings - Fork 1.4k
[Installer]: simplify container image mirroring #7156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report
@@ Coverage Diff @@ ## main #7156 +/- ## ========================================== - Coverage 19.04% 5.76% -13.29% ========================================== Files 2 13 +11 Lines 168 1162 +994 ========================================== + Hits 32 67 +35 - Misses 134 1094 +960 + Partials 2 1 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
20d5614 to 475604a Compare | /werft run 👍 started the job as gitpod-build-sje-installer-repo-mirror.2 |
475604a to 66035ee Compare | /verify-owners |
| /werft run 👍 started the job as gitpod-build-sje-installer-repo-mirror.4 |
| Like it! 🤩 Here is the result of my first try. Didn't debug it but probably we could get a better error message (minor)!? 😇 Will have a closer look after lunch. 🥣 |
| @corneliusludmann when building your Installer from source, you have to inject the versions file (handled by werft normally, and part of #6766). Can show you how to do that after lunch That error message is written by the Docker image formatter |
66035ee to 4a0ece1 Compare
corneliusludmann left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a few comments. Please let me know what you think about it. 🙏
| rawImages := make([]string, 0) | ||
| for _, item := range k8s { | ||
| rawImages = append(rawImages, getPodImages(item)...) | ||
| rawImages = append(rawImages, getGenericImages(item)...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to understand what happens: We are looking in the generated k8s output for everything that looks like an image, right?
When we install Gitpod, is there a place where we replace all these images with our mirrored ones? Or is that still to come?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this has been done. The common.ImageName function is used for images where we specify the container path as part of the called - this is the case for all Gitpod images, but also a few others (eg, the kube-rbac-proxy image).
There is also the ThirdPartyContainerRepo function if it's something which may be a non-Gitpod registry or uses the registry if it's mirrored. The default value can legitimately be "" as it will default to docker.io, such as here
I've tested all this with a third-party registry and it works ok - happy to demo it to you if you'd like to see it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I see when I change repository in the config, the third-party images are fetched from this repos as well.
However, I wonder what the use case for the --exclude-third-party flag would look like? This flag would only make sense when the users are able to tell the installer that all Gitpod images should be fetched from their private repo but the third-party images from the original repo, wouldn't it? Or is it more that the users have a mirror for the third-party images already in place but need to add the Gitpod images to their repo as well? Is that actually a possible use case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, talking with some of the community, it appears that there is a desire to only mirror the Gitpod images as they already mirror public registries (quay.io, docker.io etc). You're right that it will likely be an edge case, but there is a legitimate use case for it (and repo mirroring is an edge case anyway)
4a0ece1 to 0917019 Compare 93af1c2 to 66e411e Compare | /werft run 👍 started the job as gitpod-build-sje-installer-repo-mirror.9 |
66e411e to d4da07e Compare | /werft run 👍 started the job as gitpod-build-sje-installer-repo-mirror.12 |
| /werft run 👍 started the job as gitpod-build-sje-installer-repo-mirror.13 |
Considering that the CLI is basically API, this might be a worthwhile bit of future-proofing. Note: it would just be |
d9c2109 to 7d9d2ff Compare 7d9d2ff to fb25b91 Compare | I tried this PR by running However, I got the error The output of |
fb25b91 to 7b9b139 Compare | My bad @meysholdt. I updated the command as per @csweichel's request so that the command is Should be working ok for you now. Apologies and good catch |
| This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
The output gives the original image name and tag and generates the new image name to be used
7b9b139 to ad5937e Compare | /unhold |
| /lgtm |
| LGTM label has been added. DetailsGit tree hash: 16ec954fcaad74d1e725572fb798a7cd73401e78 |
| [APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: corneliusludmann, csweichel, laushinka Associated issue: #6756 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Description
Image mirroring is something that is crucial to air-gapped installations. As part of that, repository mirroring is necessary to allow users to pull images into their own container registries.
This adds a
gitpod-installer render mirrorcommand. It reads the currentgitpod-config.yaml, generates the YAML with the default Gitpod registry, finds anyimage:tags in the YAML and changes the URLs to the registry that the user chooses.The data is output in the format:
It also gives the option to output in either JSON or YAML format.
Related Issue(s)
Fixes #6756
How to test
Follow the instructions in
gitpod-installer mirror list -hTo mirror a repo, can use jq to iterate through:
Then deploy a cluster as-per #6236
Release Notes
Documentation