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

feat(manager/kustomize): Support inflating helm charts #34277

Open
wants to merge 31 commits into
base: main
Choose a base branch
from

Conversation

micke
Copy link

@micke micke commented Feb 18, 2025

Changes

  1. Add support for extracting helmGlobals options from kustomization files to support custom destination for inflated helm charts.
  2. Add support for inflating helmchart deptypes in the kustomize manager.

Context

Closes #14137

The helm charts will be inflated if any of the following is true:

  1. The currentVersion is inflated, OR
  2. The kustomizeInflateHelmCharts postUpdateOptions is enabled.

If the currentVersion is inflated then they will be deleted.

If the chart is already inflated then Renovate won't try to inflate them again.

I decided to accomplish this by directly interfacing with helm commands to inflate the charts by calling helm add instead of relying on using kustomize build to have kustomize inflate the charts.

I took this approach because i've seen setups where a kustomization might need pre-processing to be able to be built, a common example of this might be encrypted secrets, where the secrets referenced in the kustomization need to be decrypted before using kustomize build.

I've tried to structure the code so that it would work when a dependency is upgraded but i also envision a scenario where Renovate could be used to inflate existing charts used in kustomize kind of like how Renovate today can generate a PR to pin docker digests with a "Pin dependencies" PR when using docker:pinDigests.
But i'm not yet comfortable enough with the codebase to dive deeper into what it would take to make that a possibility, so i would greatly appreciate guidance on that.

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

@micke
Copy link
Author

micke commented Feb 19, 2025

I've run this on a repository with two example kustomization.yaml files, one with "regular" helm charts and one with OCI chart: https://github.com/micke/renovate-kustomize-artifacts

The resulting "regular" helm chart PR: micke/renovate-kustomize-artifacts#15
And the resulting OCI chart PR: micke/renovate-kustomize-artifacts#8

A side effect of having the helm charts inflated is that renovate manages updates for sub-charts and images in these inflated charts.
How should we reason about those? Do we leave it up to the user to exclude/ignore the inflated charts or can and should we do something about that?

@micke micke requested a review from viceice February 19, 2025 16:56
@micke
Copy link
Author

micke commented Feb 21, 2025

Would be great to get another review on this!

@micke micke requested a review from viceice February 28, 2025 22:21
@micke micke requested a review from viceice March 2, 2025 00:40
micke and others added 2 commits March 5, 2025 17:54
@micke micke requested a review from viceice March 5, 2025 16:56
@micke micke requested a review from viceice March 6, 2025 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for inflating helmchart deptype upgrades in the kustomize manager
3 participants