fonzdm / servarr

Just trying to make a Servarr helm chart. Help
GNU Affero General Public License v3.0
6 stars 1 forks source link

storageClass yaml anchor not working #53

Open emouawad opened 1 week ago

emouawad commented 1 week ago

Description

Installing the chart using remote does not properly replace storageClass yaml anchor.

Are anchors really needed in a helm context, we can use values template instead without anchors

Steps to reproduce

i haven't downloaded the chart - maybe that's the reason yaml anchors are not working?

helm upgrade -i --namespace servarr --create-namespace --repo https://fonzdm.github.io/servarr --values values.yml servarr servarr --debug

Expected behavior

Chart should replace with the proper values.

Servarr Helm Chart version

1.0.1

Relevant log output

N/A

Chart values

global:
  apikey: &apikey "aaa-bbb-ccc-ddd"
  storageClassName: &storageClassName "longhorn"
  ingressClassName: &ingressClassName "nginx"
  certManagerClusterIssuer: &issuer "clusterissuer-self-signed"

metrics:
  enabled: &metricsEnabled false

Code of Conduct

emouawad commented 1 week ago

Related to issue

imgios commented 1 week ago

Hi @emouawad, thank you for reporting this! Can I ask you to run the following command to retrieve all the values and share them with us?

$ helm get values -n <namespace> <release-name> --all

@fonzdm let's test this also in our env.

About anchors usage in the values: we mainly use them for the TrueCharts subcharts values, e.g.:

https://github.com/fonzdm/servarr/blob/80b51c00d253efb14e5ea540b7e85fa5ce2d8f2e/servarr/values.yaml#L559

Do you think there's another cleaner way to do that? We are open to suggestions and contributions 😊

emouawad commented 5 days ago

Not an expert on helm charts, but should be able to use helm templates instead of yaml anchors:

I have seen this in many charts - something like this:

storageClass: '{{ .Values.global.storageClassName }}'
imgios commented 5 days ago

I see your point, and this technique is really helpful when you are modelling resources within the chart, e.g.,: https://github.com/fonzdm/servarr/blob/80b51c00d253efb14e5ea540b7e85fa5ce2d8f2e/servarr/templates/pvc.yaml#L12

In this case, the aim is to reduce the amount of duplicate parameters required for the subcharts installation (*rr apps), which are responsible to (define and) deploy each app, that's why we are using anchors.