2

i'm triyng to do one Helm Chart for different environments. In many tutorials such scheme should works, but my structure does not read value from dependency repository. Helm just ignores it.

I have following folder structure

helm
   - charts
       - core-web
           - Chart.yaml
           - values.yaml
           - templates
       - frontend
           - Chart.yaml
           - values.yaml
           - templates
   - prod
       - Chart.yaml
       - values.yaml
   - dev
       - Chart.yaml
       - values.yaml

prod/Chart.yaml

apiVersion: v1
name: test
version: 1.0.0

dependencies:
  - name: core-web
    version: "1.37.0"
    repository: file://../charts/core-web/
  - name: frontend
    version: "1.6.0"
    repository: "file://../charts/frontend"

From helm folder i execute following command

helm install ./prod --dry-run --generate-name -n sandbox -f prod/values.yaml
Error: INSTALLATION FAILED: found in Chart.yaml, but missing in charts/ directory: core-web, frontend

If i move charts forlder to prod folder, then everithing works. Why helm does not accept file path from dependency repository? It should: https://helm.sh/docs/helm/helm_dependency/

Thanks for the help.

JDev
  • 2,157
  • 3
  • 31
  • 57

1 Answers1

4

Try to replicate the issue, seems like a cache issue

you can verify that helm dependency on which path it's looking for charts.

helm template test ./prod
#output Error: found in Chart.yaml, but missing in charts/ directory: backend, web-app

then I tried to verify the path on which the helm looking

helm dep ls ./prod

from the output its clear it's still looking into the wrong path with the status missing as its still looking for chart inside prod folder.

NAME    VERSION REPOSITORY              STATUS
backend 1.2.3   file://charts/backend/  missing
web-app 1.2.3   file://charts/web-app/  missing

so to fix this

helm dependency update  ./prod

then I can see

helm dep ls ./prod

enter image description here

Adiii
  • 54,482
  • 7
  • 145
  • 148
  • Thanks a looot. It's working! But it generates dependencies tar.gz dependencies in charts folder. It should be there? And values from parent chart does not overriding the same values in dependent charts. Have you any idea? Thanks! – JDev Oct 09 '22 at 10:17
  • 1
    Ok. I found how to override values in dependent charts. Simply set chart name as global key. – JDev Oct 09 '22 at 10:51
  • @JDev Hi! Can you please elaborate on setting the dependent chart name as global key to override its values? I'm just starting with Helm and I'm stuck right on this one. Thank you very much! – Vincenzo Jan 19 '23 at 13:16
  • Hi @Vincenzo sorry, I did not understand your question. – JDev Jan 19 '23 at 14:48
  • Say `Chart1` depends on `Chart2` (via declaring Chart2 path in Chart1's Chart.dependencies). `Chart2` has a `secret.yaml` in its template folder which name is declared in `Chart2`'s `Values` file as `secret_name: someName`. If I didn't get the process wrong, by declaring the same `secret_name: someDifferentName` in `Chart1`'s `Values` file, `Chart2`'s `secret_name` gets the `someDifferentName`value. – Vincenzo Jan 19 '23 at 15:18
  • With `Simply set chart name as global key` which Chart you're referring to? Parent or child? How you do declare it as a global key?? – Vincenzo Jan 19 '23 at 15:20