airshipit / treasuremap

Reference Airship manifests, CICD, and reference architecture.
http://openstack.org
Apache License 2.0
52 stars 39 forks source link

Helm chart collator chart version update handling #164

Closed seaneagan closed 3 years ago

seaneagan commented 3 years ago

Problem description (if applicable)

We are currently exposing hard coded chart versions in the helm collator output image: https://github.com/airshipit/images/blob/b7d03d4def5c58302c322f94fe5827145f351776/helm-chart-collator/config/charts.yaml#L7

If we update the content without updating the exposed version, then the flux source-controller will have no way to know that it needs to re-download the chart from the helm repository. So we need to at least update the chart versions in the helm collator when they become available. This can be done by using the default unique chart versions generated by the helm chart collator: https://github.com/airshipit/images/blob/58b69cea414bf799082e0e280041f3f127b8fe72/helm-chart-collator/playbooks/roles/install_git_repo_charts/tasks/main.yaml#L30-L37

For the helm chart version used in the HelmReleases, we could leave them unset, in which case the source-controller will use the latest version, which it should discover the new version each time it re-indexes the HelmRepository, which it does on a configurable time interval. This would mean though that the HelmRelease may get reconciled at an arbitrary time, separate to the update that will happen if/when the HelmRelease itself gets updated with e.g. new values overrides.

So in order to ensure a single coordinated update to the HelmRelease with the new chart version, we would want to set the version explicitly to the unique one generated by the helm chart collator referenced above in each HelmRelease (still via the ReplacementTransformer). The helm-chart-collator image build does output the generated versions in its logs, but we should output them to an more easily consumable file, likely can just store the helm repo index file in the zuul build output. Then in order to consume this new helm chart collator version in e.g. treasuremap, these values would need to be manually copied to the versions catalogue (at least for the charts that changed). Or we could perhaps try to automate the updating of the versions catalogue by downloading the configured helm collator image, extracting the helm repo index, translating it into versions catalogue format, and writing that to the appropriate location in the manifests, which may be easier if we moved the chart versions to their own catalogue.

seaneagan commented 3 years ago

https://review.opendev.org/c/airship/images/+/794657

seaneagan commented 3 years ago

https://review.opendev.org/c/airship/treasuremap/+/795165

seaneagan commented 3 years ago

https://review.opendev.org/c/airship/images/+/794838

seaneagan commented 3 years ago

Now that https://review.opendev.org/c/airship/images/+/794657 is merged, we just need to update treasuremap to use the unique versions it produced, and document this process, and then we can close this.

seaneagan commented 3 years ago

https://review.opendev.org/c/airship/treasuremap/+/796933

lb4368 commented 3 years ago

Closed per patchset merge