Hi all, I have a case where I have a helm chart th...
# kubernetes
s
Hi all, I have a case where I have a helm chart that uses a default values.yaml and a environment specific values.yaml. Based on the Helm Release documentation (https://www.pulumi.com/registry/packages/kubernetes/api-docs/helm/v3/release/#valueyamlfiles_csharp) and this feature request (https://github.com/pulumi/pulumi-kubernetes/issues/659) I thought it is possible to use
ValueYamlFiles
to add these files like this:
Copy code
ValueYamlFiles= new InputList<AssetOrArchive>
{
    new FileAsset($"{appValuesPath}/values.yaml"),
    new FileAsset($"{appValuesPath}/values.{projectEnvironment}.yaml")
}
Somehow only the last specified values.yaml is read and used for the Helm Release. Has anyone encountered a similar issue or has an idea how to solve this?
s
are you able to add your yaml files here?
s
Sure, I'll remove some private values but the behaviour is the same. Here the default `values.yaml`:
Copy code
image:
  repository: some-repository

envVariables:
  DOTNET_ENVIRONMENT: Staging
  Kestrel__Endpoints__Http__Protocols: Http1AndHttp2

envSecrets:
  ConnectionStrings: ...

ports:
  - name: http
    port: 80
  - name: https
    port: 443
  - name: grpc
    port: 5002
Here the environment specific `values.dev.yaml`:
Copy code
envVariables:
  App__SelfUrl: <https://some.dev.domain.com/>
  Kestrel__Endpoints__Http__Url: <http://some.dev.domain.com/>
After some further tests I now found out this is a problem when you use the same key in both files (in this case
envVariables
). My test suggest that if you use different keys the two files successfully get merged and a combination of both get's used for the Values in the Helm Release.
s
Sounds like the merge function does a shallow merge rather than a deep merge. Maybe you can create a github issue for an enhancement of one doesn’t always exist? And in the meantime you could work around this by merging the yaml yourself with C# code and passing in the values rather than using ValueYamlFiles
s
I decided to merge the yaml files in c# and then and passing it in the
Values
. Thanks for your assistance!
d
Could one of you file a bug into pulumi-kubernetes for this (the shallow vs deep merge)?