pulumi-kubernetes
pulumi-kubernetes copied to clipboard
[Helm/Release] values are not compatible with helm chart values
Using the dotnet/c# sdk, I tried switching from helm charts to helm releases but the values are not compatible since it doesn't support serializing anonymous types, so although it compiles, it fails at runtime.
Steps to reproduce
- Run gitfool/Pulumi.Dungeon/test using helm charts @ e0354be which succeeds (test-k8s-charts.log)
- Run gitfool/Pulumi.Dungeon/test using helm releases @ a1782b5 which fails (test-k8s-releases.log)
This is just the first failure of many due to the use of anonymous types, for example with cert-manager:
var certManagerValues =
new Dictionary<string, object>
{
["prometheus"] = new
{
enabled = true,
servicemonitor = new { enabled = true }
}
};
This would work for helm releases if I refactored all nested values to use dictionaries:
var certManagerValues =
new Dictionary<string, object>
{
["prometheus"] = new Dictionary<string, object>
{
["enabled"] = true,
["servicemonitor"] = new Dictionary<string, object> { ["enabled"] = true }
}
};
But that is not desirable and I expected helm releases to be a drop in replacement for helm charts, from an api pov, and being able to use anonymous types in c# is essential to reduce the ceremony required to specify helm values. I've included lots of commonly used helm charts for reference; see K8sStack.cs.