Import-values feature in requirements.yaml of Kubernetes-helm is not working

11/20/2017

I am facing a problem with helm subcharts, the import-values features in requirements.yaml is not working.

What was done:

created parent chart with following values.yaml

# parent's values.yaml file
myimports:
  myint: 0
  mybool: false
  mystring: "helm rocks!"

created subchart1 chart with following values.yaml

# subchart1's values.yaml file
default:
  data:
    myint: 999
    mybool: true

created requirements.yaml in parent chart.

# parent's requirements.yaml file
dependencies:
  - name: subchart1
    repository: http://127.0.0.1:8879/charts
    version: 0.1.0
    ...
    import-values:
      - child: default.data
        parent: myimports

executed following commands

 $ helm package subchart1
 $ helm dependency update parent/
 $ helm dependency build parent/

What happens:

  1. both update and build command gets completed successfully.
  2. subchart1 gets downloaded from local helm server and gets placed in ./parent/charts/ directory

Expected output:

# parent's final values
myimports:
  myint: 999
  mybool: true
  mystring: "helm rocks!"

Problem:

The parent chart's values.yaml is not getting updated.

helm version:

Client: &version.Version{SemVer:"v2.7.0", GitCommit:"08c1144f5eb3e3b636d9775617287cc26e53dba4", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.7.0", GitCommit:"08c1144f5eb3e3b636d9775617287cc26e53dba4", GitTreeState:"clean"}`
-- codenio
charts
kubernetes-helm

1 Answer

10/24/2018

If you mean the values.yaml of parent is not updated; it is not expected either. The final effective values are updated at runtime. It doesn't update your values.yaml file.

You might run helm install --dry-run --debug parent and see the effect under the COMPUTED VALUES: section of output.

-- hedayat
Source: StackOverflow