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

Support Renovating HelmRelease CRD #5984

Closed
adusumillipraveen opened this issue Apr 16, 2020 · 20 comments · Fixed by #13566
Closed

Support Renovating HelmRelease CRD #5984

adusumillipraveen opened this issue Apr 16, 2020 · 20 comments · Fixed by #13566
Assignees
Labels
new package manager New package manager support priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others status:requirements Full requirements are not yet known, so implementation should not be started type:feature Feature (new functionality)

Comments

@adusumillipraveen
Copy link
Contributor

What would you like Renovate to be able to do?
Raise Pull Requests for updates to HelmRelease CRDs with latest helm charts versions.

Describe the solution you'd like
Extend the solution of Helm requirements.yaml to renovate HelmRelease CRD. For example, actual version that needs to be updated is here

Describe alternatives you've considered
No other alternatives available at the moment.

Additional context
Reuse as described in #3414 (comment)

@rarkins rarkins added type:feature Feature (new functionality) needs-requirements new package manager New package manager support priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others labels Apr 17, 2020
@rarkins
Copy link
Collaborator

rarkins commented Apr 17, 2020

  • Is there a specification for this file format?
  • Are these referencing helm charts, or do we need a new datasource for something else?

@adusumillipraveen
Copy link
Contributor Author

@rarkins
Copy link
Collaborator

rarkins commented Apr 17, 2020

The spec is a little overwhelming for me to be sure, but is this possibly very simple? e.g. is there a 1:1 mapping between the HelmRelease CRD and a Helm chart?And then just look in spec.chart?

@adusumillipraveen
Copy link
Contributor Author

The spec is a little overwhelming for me to be sure, but is this possibly very simple? e.g. is there a 1:1 mapping between the HelmRelease CRD and a Helm chart?And then just look in spec.chart?

Yes, you could probably try and make sense using schema. But in simple terms, 3 fields that we need to be worried are here :

Not sure if this is of any help.

@rarkins
Copy link
Collaborator

rarkins commented Apr 17, 2020

Can you create a demo public repo that contains an example HelmRelease CRD that you know can be updated? i.e. to test any solution against

@adusumillipraveen
Copy link
Contributor Author

@adusumillipraveen
Copy link
Contributor Author

And here is the repo setup for test : https://github.com/adusumillipraveen/demo-flux-config/blob/master/demo-flux.yaml

@ChipWolf
Copy link

ChipWolf commented May 3, 2020

It's probably worth emphasising here; with the HelmRelease CRD, it's possible to specify either a chart registry, or a git repo with a path to a chart.

@ChipWolf
Copy link

ChipWolf commented May 5, 2020

With the help of @rarkins, I've managed to do this (albeit not in the cleanest way), with the existing version of Renovate. See #6130

@adusumillipraveen
Copy link
Contributor Author

Thanks @ChipWolf , will give it a try now and let you know how it goes.

@adusumillipraveen
Copy link
Contributor Author

That works perfect, Thanks @ChipWolf . Appreciate your time on this.

@RichiCoder1
Copy link
Contributor

RichiCoder1 commented Oct 5, 2020

Per #7415, would love to see both Helm Operator and Helm Controller support.

Helm Controller is the eventual successor of Helm Operator. It has additional complexity as it breaks the Helm Repository/Git Repository portion into it's own CRD. So an implementation would need to a two-pass approach to accumulate repository urls and their labels/name, and then accumulate HelmReleases.

@rarkins rarkins added the status:requirements Full requirements are not yet known, so implementation should not be started label Jan 12, 2021
@onedr0p
Copy link
Contributor

onedr0p commented Feb 16, 2021

For those interested, I and @bjw-s created a Github action (and standalone script) to update the Helm Release files with a renovate annotation (comment). It expects your HelmRepository and HelmRelease files to be found anywhere under a certain directory.

See here: https://github.com/k8s-at-home/renovate-helm-releases

@danports
Copy link
Contributor

I've taken a crack at implementing a proper Flux package manager that can renovate HelmRelease manifests by parsing both HelmRelease and HelmRepository manifests and stitching the two together. It is very basic at the moment, but is passing one test. Will do some further testing and then open a PR.

@danports
Copy link
Contributor

danports commented Jan 14, 2022

Feel free to give my branch a try on your Flux repositories. The local development instructions make it fairly simple. I've tested my changes on my main Flux repository and it is working well so far. Note that you will need to define fileMatch for the flux manager as described in the docs.

@onedr0p
Copy link
Contributor

onedr0p commented Jan 14, 2022

@danports This is awesome! I'll try to get some time in to test against my repository as well. Also, there's a whole bunch of repos you could pull down and test this on over at https://github.com/k8s-at-home/awesome-home-kubernetes

@onedr0p
Copy link
Contributor

onedr0p commented Jan 15, 2022

To sum up the testing steps from the docs...

git clone git@github.com:danports/renovate.git
cd renovate
git checkout flux-manager
yarn install
yarn build
yarn test # optional
RENOVATE_TOKEN=ghp_... LOG_LEVEL=debug yarn start owner/repository

@danports
Copy link
Contributor

@onedr0p Yep - you can omit yarn test, but you'll need to add something like "flux": { "fileMatch": ["\\.yaml$"] } to your Renovate configuration for the new package manager to do anything.

@onedr0p
Copy link
Contributor

onedr0p commented Jan 15, 2022

It worked fine for me, this is amazing. Can't wait to see it merged, thanks @danports

@renovate-release
Copy link
Collaborator

🎉 This issue has been resolved in version 31.35.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

crutonjohn added a commit to crutonjohn/gitops that referenced this issue Jan 19, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
new package manager New package manager support priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others status:requirements Full requirements are not yet known, so implementation should not be started type:feature Feature (new functionality)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants