Skip to content
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

Charts: add registry templating to support Elemental airgap scenarios #497

Merged
merged 8 commits into from
Aug 23, 2023

Conversation

fgiudici
Copy link
Member

@fgiudici fgiudici commented Aug 11, 2023

The chart has the .Value.registry_url variable now.
By default it will point to the "official" registries ("registry.suse.com" or even "registry.opensuse.org/isv/rancher/elemental/dev/containers") but if set during chart installation (--set registry_url=$MY_PRIVATE_REGISTRY:$PORT) it will allow to point to a private registry.
Worth to noting that the registry templating is done in such a way to support and not confllct with the Rancher Marketplace templating once the Elemental charts will land there.

Rancher annotations have been updated too.

Last note: this PR changes the makefile to set the default values of the container images to point to the images built on OBS Dev channel. This may be of help when reviewing the github release process (to allow pointing directly at OBS images).

Fixes #496

drop experimental, add few more (affects only installation from Rancher
Marketplace) and remove useless ones on crds chart.

Signed-off-by: Francesco Giudici <[email protected]>
also remove the registry url from the default images reference:
resources are already templated getting the registry url from the
global.cattle.systemDefaultRegistry variable.

Signed-off-by: Francesco Giudici <[email protected]>
Signed-off-by: Francesco Giudici <[email protected]>
@fgiudici fgiudici requested a review from a team as a code owner August 11, 2023 15:53
@github-actions github-actions bot added the area/build build related changes label Aug 11, 2023
@codecov
Copy link

codecov bot commented Aug 11, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (ffb9c01) 51.50% compared to head (ea19355) 51.50%.
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #497   +/-   ##
=======================================
  Coverage   51.50%   51.50%           
=======================================
  Files          41       41           
  Lines        5551     5551           
=======================================
  Hits         2859     2859           
  Misses       2443     2443           
  Partials      249      249           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fgiudici
Copy link
Member Author

fgiudici commented Aug 11, 2023

While the chart building test fails (as the expected image references are different now) and should be fixed before merging, would be good to get some reviews here.
Tested successfully in an online environment (performed update) and on an airgapped one (installed, loading the elemental-operator and seedimage-builder images in a private registry first and installing the helm chart with --set registry_url )

Copy link
Contributor

@anmazzotti anmazzotti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me beside the kube-version and rancher-version ranges.
They are nice to have, I'm more curious about the values.

catalog.cattle.io/certified: rancher
catalog.cattle.io/display-name: Elemental
catalog.cattle.io/experimental: "true"
catalog.cattle.io/kube-version: '>= 1.23.0-0 < 1.28.0-0'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how/where did you define this range?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a mandatory annotation for the Rancher Marketplace: since these annotations are for Rancher only, seems to me that makes sense to add all the required ones.
Kubernetes 1.23 is the minimal version supported by Rancher 2.7.x and we require Rancher 2.7.x.
Kubernetes 1.28 is just an high Kube version: the value is arbitrary high and the common one used in the Rancher 2.7 marketplace.
I don't think this restriction will be put in place ever, in any case I wish that for Kube 1.28 users will install a newer chart version 😄

catalog.cattle.io/provides-gvr: elemental.cattle.io/v1beta1
catalog.cattle.io/rancher-version: '>= 2.7.0-0 < 2.8.0-0'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, this also seem rather strict

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, this is different IMO: we don't support Rancher 2.6.x.
Moreover, we don't know if this chart will be compatible with Rancher 2.8.0: a lot could change there.
We will expand the supported versions when needed, but for sure we want the older chart versions to disappear by default from the marketplace for future Rancher versions (we want to release newer charts... or rebuild the same with updated tags is needed after proper testing).
This also is a common pattern in Rancher Marketplace charts.

Copy link
Contributor

@davidcassany davidcassany left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The target of this PR is unclear to me, shouldn't this be applied to the OBS chart?
These changes will mostly not land in OBS (they should be applied on .obs/charts/*) and eventually break it depending on the specific changes.

I'd be in favor of moving the charts to some sort of github release that is consumable according to the marketplace needs. And get rid of the charts in OBS completely. @fgiudici shall we create a new card for that or this is already in progress somewhere?

Airgap could be managed via Rancher Marketplace once we will have our
chart landing there (excluding the teal OS images).
We could anyway provide registry templating to allow separate airgap
management of the operator, seedimage-builder and channel images.

Signed-off-by: Francesco Giudici <[email protected]>
@fgiudici
Copy link
Member Author

The target of this PR is unclear to me, shouldn't this be applied to the OBS chart? These changes will mostly not land in OBS (they should be applied on .obs/charts/*) and eventually break it depending on the specific changes.

The target of these changes is to support templating for an airgapped scenario (and for Rancher Marketplace too).

I'd be in favor of moving the charts to some sort of github release that is consumable according to the marketplace needs. And get rid of the charts in OBS completely. @fgiudici shall we create a new card for that or this is already in progress somewhere?

That it is tracked in #460 , which blocks on the Rancher Marketplace release (#376).
This fixes #496 which is part of #376. This is somehow an intermediate step.
Still, the templating has effects on the github workflows that should be updated and fixes in this PR 😓

this is needed to align with the registry/repo templating introduced for
airgapped scenario support.

While there, also drop the SEEDIMAGE_TAG: just use the common TAG for
the seedimage container image.

Signed-off-by: Francesco Giudici <[email protected]>
update to the newer repo/registry templating.

Signed-off-by: Francesco Giudici <[email protected]>
@davidcassany
Copy link
Contributor

The target of this PR is unclear to me, shouldn't this be applied to the OBS chart? These changes will mostly not land in OBS (they should be applied on .obs/charts/*) and eventually break it depending on the specific changes.

The target of these changes is to support templating for an airgapped scenario (and for Rancher Marketplace too).

Sure, however by the target I meant where do you expect the changes to be effective, I mean, why those changes are not applied in .obs/chartfile/crds/Chart.yml and .obs/chartfile/operator/Chart.yaml, etc. To me it looks like they should be there too as these are the actual charts we are releasing. Hopefully we can get rid of one of the two in #333 and #460 scope, but IMHO meanwhile we should keep all chart changes, at least, in OBS if not both.

Signed-off-by: Francesco Giudici <[email protected]>
Signed-off-by: Francesco Giudici <[email protected]>
@fgiudici
Copy link
Member Author

why those changes are not applied in .obs/chartfile/crds/Chart.yml and .obs/chartfile/operator/Chart.yaml, etc. To me it looks like they should be there too as these are the actual charts we are releasing. Hopefully we can get rid of one of the two in #333 and #460 scope, but IMHO meanwhile we should keep all chart changes, at least, in OBS if not both.

You are absolutely right! Synced OBS charts.

Copy link
Contributor

@davidcassany davidcassany left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! 👍 now it will land in OBS too 😉

@fgiudici fgiudici merged commit 08934ee into rancher:main Aug 23, 2023
15 checks passed
@fgiudici fgiudici deleted the airgap branch August 25, 2023 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/build build related changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[airgap] allow registry templating in the Chart
3 participants