helm icon indicating copy to clipboard operation
helm copied to clipboard

use bitnami charts as dependencies

Open christianhuth opened this issue 2 years ago • 8 comments

Suggestion for improvement and simplification

Instead of defining MySQL and Redis "charts" as subcharts just use existing charts from Bitnami:

  • https://artifacthub.io/packages/helm/bitnami/mysql
  • https://artifacthub.io/packages/helm/bitnami/redis

christianhuth avatar May 16 '22 20:05 christianhuth

Thanks for reporting. Would it be possible to update the chart to use MySQL subchart preserving the PVC that holds data?

rubenhak avatar May 17 '22 18:05 rubenhak

@rubenhak there is an option in values.yaml to use an existing PVC: https://artifacthub.io/packages/helm/bitnami/mysql?modal=values&path=primary.persistence.existingClaim. So it should be possible if the used MySQL versions are the same.

christianhuth avatar Jul 05 '22 08:07 christianhuth

@christianknell, thanks, that's a good finding! Do you know if the volumes would be compatible between mysql and bitnami/mysql images?

@christianknell, @tanmay-bhat, do you think we can get some community help to use dependent subcharts for mysql and redis?

rubenhak avatar Jul 08 '22 16:07 rubenhak

@rubenhak the Bitnami charts are run as non-root user. So i think the PVC can't be used right away because the file permissions wouldn't match. But the Bitnami charts come with an option to set these file permissions on initialization: https://artifacthub.io/packages/helm/bitnami/mysql?modal=values&path=volumePermissions. So from my perspective they should be compatible, but i haven't tried this so far.

If you decide to switch to the Bitnami charts i can help you with development. See https://github.com/christianknell/helm-charts/tree/main/charts/shlink-backend for an example on how to define the dependencies and use the values in your own chart.

christianhuth avatar Jul 27 '22 08:07 christianhuth

@christianknell, I guess we can compromise one time upgradability to use Bitnami sub-charts.

A help would be awesome! I looked through the chart definition, could see the chart dependency and the "mysql.enabled" flag, but couldn't see how other mysql variables are passed to the chart. Can you show how this would work with subcharts?

rubenhak avatar Jul 28 '22 16:07 rubenhak

@rubenhak: i will have a try to use an existing pvc, when i start the transition to the Bitnami sub-charts.

Sub-charts are defined through "an extra hierachy" in your values.yaml. You can see in this example values.yaml the key mysql which takes the values for the mysql sub-chart. This works the same way with every sub-chart in Helm. See also this description in the documentation.

christianhuth avatar Jul 29 '22 10:07 christianhuth

@rubenhak: I would try to migrate to the Bitnami charts between Christmas and new year's eve. Could you move this issue to the new helm repository please?

christianhuth avatar Dec 23 '22 14:12 christianhuth

@christianknell, Done. Thanks!

rubenhak avatar Dec 24 '22 06:12 rubenhak