question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Helm/Release] Does not accept an Output in the chart values

See original GitHub issue

The current implementation of k8s.helm.v3.Release is not accepting pulumi.Output in the chart values, which was supported in k8s.helm.v3.Chart from what I can tell, or at least the Chart did not error in the preview stage with the same values which the Release does.

In my case, I’m trying to deploy the ingress-nginx helm chart with a controller.service.loadBalancerIP value fed in from a previously created gcp.compute.GlobalAddress resource. Currently this fails in the chart rendering phase and I have to work around it.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
lblackstonecommented, Oct 6, 2021

Here’s a simpler repro case:

import * as random from "@pulumi/random";
import * as k8s from "@pulumi/kubernetes";

const nsName = new random.RandomPet("test");

const ns = new k8s.core.v1.Namespace("test", {
    metadata: {
        name: nsName.id
    }
});

new k8s.helm.v3.Release("nginx", {
    chart: "nginx",
    namespace: ns.metadata.name,
    repositoryOpts: {
        repo: "https://charts.bitnami.com/bitnami",
    },
    values: {},
});

Running pulumi up on an empty stack returns the following error:

  kubernetes:helm.sh/v3:Release (nginx):
    error: decoding failure: 1 error(s) decoding:

    * 'Namespace' expected type 'string', got unconvertible type 'resource.Computed', value: '{{}}'
0reactions
gitfoolcommented, Sep 26, 2021

I’m also hitting this issue:

// aws load balancer controller; https://github.com/aws/eks-charts/tree/master/stable/aws-load-balancer-controller
Logger.LogDebug("Installing aws load balancer controller");
var awsLbcRole = new RoleX($"{k8sPrefix}-aws-load-balancer-controller",
    new RoleXArgs
    {
        AssumeRolePolicy = IamHelpers.AssumeRoleForServiceAccount(oidcArn, oidcUrl, "kube-system", "aws-load-balancer-controller", awsProvider),
        InlinePolicies = { ["policy"] = ReadResource("AwsLoadBalancerPolicy.json") }
    },
    new ComponentResourceOptions { Provider = awsProvider });

var awsLbcCrds = new ConfigGroup("aws-load-balancer-controller-crds",
    new ConfigGroupArgs { Yaml = ReadResource("AwsLoadBalancerCrds.yaml") },
    new ComponentResourceOptions { Provider = k8sProvider });

var awsLbcValues = Output.Tuple(clusterName, awsLbcRole.Arn).Apply(((string ClusterName, string RoleArn) tuple) =>
    new Dictionary<string, object>
    {
        ["clusterName"] = tuple.ClusterName,
        ["enableCertManager"] = true,
        ["serviceAccount"] = new { annotations = new Dictionary<string, string> { ["eks.amazonaws.com/role-arn"] = tuple.RoleArn } }
    }.ToDictionary());

var awsLbcRelease = new Release("aws-load-balancer-controller", // ingress records with alb.ingress.kubernetes.io annotations depend on chart finalizers
    new ReleaseArgs
    {
        Namespace = "kube-system",
        Name = "aws-load-balancer-controller",
        RepositoryOpts = new RepositoryOptsArgs { Repo = "https://aws.github.io/eks-charts" },
        Chart = "aws-load-balancer-controller",
        Version = K8sConfig.AwsLbcChartVersion,
        Values = awsLbcValues,
        SkipCrds = true,
        Atomic = true
    },
    new CustomResourceOptions { DependsOn = { awsLbcCrds, certManagerRelease }, Provider = k8sProvider });

Fails with error coming from aws-load-balancer-controller/deployment:

Diagnostics:
 
aws-load-balancer-controller (kubernetes:helm.sh:Release)
error: failed to create chart from template: execution error at (aws-load-balancer-controller/templates/deployment.yaml:52:28): Chart cannot be installed without a valid clusterName!

Where clusterName is valid and being passed, albeit via an output tuple.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Manage Helm Releases - Flux CD
The helm-controller allows you to declaratively manage Helm chart releases with Kubernetes manifests. It makes use of the artifacts produced ...
Read more >
Helm - Argo CD - Declarative GitOps CD for Kubernetes
The flag can be repeated to support multiple values files: ... Please note that overriding the Helm release name might cause problems when...
Read more >
circleci/helm - CircleCI Developer Hub
install-helm-chart ; namespace. The kubernetes namespace that should be used. '' type: string ; no-output-timeout. Elapsed time that the helm ...
Read more >
HELM Best practices · Codefresh | Docs
Codefresh also has built-in support for Helm packages, deployments, ... There is no technical requirement that a Helm chart must be uploaded to...
Read more >
GitLab Runner Helm Chart
Take note of the format. The value is not prefixed by a name tag as is the convention in Kubernetes resources. An array...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found