-
Notifications
You must be signed in to change notification settings - Fork 21
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
Add 'make airgap-package' target and associated scripts for bundling images for air gap #475
Conversation
984719f
to
8f23c9b
Compare
a20a5e0
to
24b4e78
Compare
93428f8
to
36e5228
Compare
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.
Several issues with make targets
The scripts should be revisited.
One general important note regarding bash syntax:
There is a convention that local scope variable names should be always lower snake case. Uppercase names are usually reserved only for env variables (in rare cases for global ones in scope of script)
Ditching this rule makes script harder to read and reason about. Please fix
templates/cluster/vsphere-hosted-cp/templates/k0smotroncontrolplane.yaml
Outdated
Show resolved
Hide resolved
templates/cluster/vsphere-standalone-cp/templates/k0scontrolplane.yaml
Outdated
Show resolved
Hide resolved
d41d942
to
11bc596
Compare
|
128ad6d
to
d2bda51
Compare
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.
EXPORT_ALL_VARIABLES does not appear to play nicely with other Makefile targets and export does not appear to actually populate the variables
export
should work at least with GNU Make 4.4 (especially if .EXPORT_ALL_VARIABLES
works) (see manual)
Anyway if it's became too complex I will not block this PR. Issues with Makefile will be fixed in scope of #589
A couple of small issues should be fixed in the script however (Note that NIT comment are optional to fix)
3cdab0a
to
8487f73
Compare
Ya, I'm not sure what's going on, I've configured the exports just as the docs suggest with:
and they end up empty in the script invocation, debugged with |
ecd1adf
to
9da196e
Compare
I think I need to bring back the
It's because we're trying to remove the |
02ef954
to
b154696
Compare
b154696
to
12ff062
Compare
Found a bug in the |
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.
I tested the scripts on the airgapped ubuntu machine.
While testing I had multiple issues with airgapped k0s (some irrelevant to this PR).
I added several comments related to the issues I experienced.
Regarding the kube-vip
issue. It's caused by the empty value we're providing via values, so it's not related to kube-vip
chart itself. Thus I suggest adding a special case for it either adding --debug
(so it will output some yaml) or by removing empty value from the values we're providing.
custom_tag logic also could be considered, but IMO it looks more flaky.
e6c50b0
to
e85fe81
Compare
Outputting |
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.
Issue with hmc-controller image
With --insecure-skip-tls-verify
flag we're not covering http registries, but it's out of scope of this PR and should be covered in the docs.
4fb4d54
to
a338c7d
Compare
Looks like kube-vip still didn't want to render out, for now I've just added some logic to workaround this case, I kept the |
a338c7d
to
07fe7b9
Compare
07fe7b9
to
a61f3d4
Compare
* Pull charts referenced by providers k0s.extensions during helm-package In order to support airgap customers will need to place all of the charts a ManagedCluster may pull upon into a registry. This adds support to our 'helm-package' Makefile to ensure we package up all of the charts our templates reference so that they can be included in an airgap bundle. * Place k0s.extensions images in a seperate image tarball For the first iteration of airgap we're using k0s airgap bundle for the management cluster but the ManagedClusters we deploy will still need the extensions images that the extension charts reference. This patch modifies the bundle-images target so it creates two bundles, one that will serve as the management cluster bundle and one that will serve as the ManagedCluster bundle. * Add airgap-push script This script can be used to push images and Helm charts needed for an airgapped ManagedCluster deployment to a given image registry and chart repository. * Package the airgap-push script with the bundle Signed-off-by: Kyle Squizzato <[email protected]>
a61f3d4
to
3381013
Compare
I've squashed the changes down to prepare for merge/carrying of this PR since this is my last day at Mirantis and I'll be taking some time off for a bit. |
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.
LGTM
This adds new scripts for creating a bundle for airgap customers. We can easily add a step to the release CI as well, but the resulting tarball of saved images is 4.2G so I decided to not include that for now since we'll need to figure out the best place to host the tarball.
At this time this script deploys a management cluster, waits for all the providers to come up and be ready then gets a list of all the images used and pulls/saves those.
It then iterates
helm template ...
output across each of the k0s extensions we deploy and pulls/saves images affiliated with the extensions. I've also updatedhelm-package
to pull in these extensions during it's packaging process.Closes #423