-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Helm values field does not allow Input values #1340
Comments
I just hit this trying to install external dns with aws eks irsa and the dotnet sdk: // external dns; https://github.com/bitnami/charts/tree/master/bitnami/external-dns
Logger.LogDebug("Installing external dns");
var externalDnsRole = new Role($"{prefix}-external-dns",
new RoleArgs
{
AssumeRolePolicy = IamHelpers.AssumeRoleForServiceAccount(oidcArn, oidcUrl, "kube-system", "external-dns", awsProvider),
InlinePolicies = { ["policy"] = ReadResource("ExternalDnsPolicy.json") }
},
new ComponentResourceOptions { Provider = awsProvider });
new Chart("external-dns",
new ChartArgs
{
Namespace = "kube-system",
FetchOptions = new ChartFetchArgs { Repo = "https://charts.bitnami.com/bitnami" },
Chart = "external-dns",
Version = config.ExternalDnsVersion,
Values =
{
["logLevel"] = "debug",
["policy"] = "sync",
["provider"] = "aws",
["registry"] = "txt",
["txtPrefix"] = "k8s.",
["serviceAccount"] = new InputMap<object>
{
["annotations"] = new InputMap<object>
{
["eks.amazonaws.com/role-arn"] = externalDnsRole.Arn
}
}
}
},
new ComponentResourceOptions { Provider = provider }); I currently have to use apply as follows: externalDnsRole.Arn.Apply(roleArn =>
new Chart("external-dns",
new ChartArgs
{
Namespace = "kube-system",
FetchOptions = new ChartFetchArgs { Repo = "https://charts.bitnami.com/bitnami" },
Chart = "external-dns",
Version = config.ExternalDnsVersion,
Values =
{
["logLevel"] = "debug",
["policy"] = "sync",
["provider"] = "aws",
["registry"] = "txt",
["txtPrefix"] = "k8s.",
["serviceAccount"] = new Dictionary<string, object>
{
["annotations"] = new Dictionary<string, object>
{
["eks.amazonaws.com/role-arn"] = roleArn
}
}
}
},
new ComponentResourceOptions { Provider = provider })); |
I took some observations and there seems to be two problems. The use of
The above problem has a workaround of using Looking at how the output value is serialized, it looks like the serializer writes an empty object rather than a string, yielding a different error from the invoke RPC call:
The grpc log: {
"method": "/pulumirpc.ResourceProvider/Invoke",
"request": {
"tok": "kubernetes:helm:template",
"args": {
"jsonOpts": "{\"api_versions\":[],\"namespace\":\"kube-system\",\"values\":{\"logLevel\":\"debug\",\"serviceAccount\":{\"annotations\":{\"eks.amazonaws.com/role-arn\":{}}},\"provider\":\"aws\",\"txtPrefix\":\"k8s.\",\"registry\":\"txt\",\"policy\":\"sync\"},\"chart\":\"external-dns\",\"version\":\"7.3.2\",\"fetch_opts\":{\"repo\":\"https://charts.bitnami.com/bitnami\"},\"release_name\":\"external-dns\"}"
}
},
"errors": [
"rpc error: code = Unknown desc = failed to generate YAML for specified Helm chart: failed to create chart from template: YAML parse error on external-dns/templates/serviceaccount.yaml: error unmarshaling JSON: while decoding JSON: json: cannot unmarshal object into Go struct field .metadata.annotations of type string"
],
"metadata": {
"kind": "resource",
"mode": "client",
"name": "kubernetes"
}
} |
This is fixed in the upcoming Chart v4 resource. You can use output values and even use Pulumi Assets as values. Enjoy! |
Problem description
The SDK types for Helm values are defined to allow Input values, but the actual implementations appear to require prompt/resolved values. This causes errors if the user passes unresolved Input values to the Chart.
The text was updated successfully, but these errors were encountered: