https://pulumi.com logo
#general
Title
# general
g

gray-city-50684

10/27/2021, 3:02 PM
Hi, I have a question about Pulumi’s Kubernetes support, specifically Helm charts (let’s start a thread)
I have the following code:
Copy code
const linkerdChart = new k8s.helm.v2.Chart("linkerd2",
            {
                chart: "linkerd2",
                version: "2.10.2",
                namespace: "linkerd",
                values: {
                    ...
                },
                fetchOpts: {
                    repo: "<https://helm.linkerd.io/stable/>"
                },
                transformations: chartTransformations
            },
            {
                dependsOn: [ linkerdIdentityIssuerCertificate ],
                parent: this,
            }
        );

        const linkerdVizChart = new k8s.helm.v2.Chart("linkerd2-viz",
            {
                chart: "linkerd-viz",
                version: "2.10.2",
                namespace: "linkerd-viz",
                fetchOpts: {
                    repo: "<https://helm.linkerd.io/stable/>"
                },
                transformations: chartTransformations
            },
            {
                dependsOn: [ linkerdChart, linkerdIdentityIssuerCertificate ],
                parent: this,
            }
        );
It is inside a pulumi.ComponentResource
I would expect, that because the explicit dependsOn, the deployment of the linkerdVizChart to start only once the linkerdChart component has fully deployed the base chart
but that is not the case, which causes a problem, as the base chart is responsible to start a Kubernetes webhook, which in turn would do some side-container injection whn the Viz-chart is deployed
As the Viz-chart deployment starts too soon, it won’t be injected, and as it is required by the Deployments / Pods in there, they just keep on crash-looping
Is there any flag / workaround / trick, I could use to delay the Viz-chart deployment until the base-chart deployment fully finishes?
b

billowy-army-68599

10/27/2021, 4:01 PM
@gray-city-50684 there is a ready attribute on the helm chart which you can use: https://github.com/pulumi/pulumi-kubernetes/pull/1364
g

gray-city-50684

10/27/2021, 4:22 PM
Thx, I’ll try this right away
b

billowy-army-68599

10/27/2021, 4:28 PM
if you do want this level of readiness, the
helm.Release
resource might be a better bet
g

gray-city-50684

10/27/2021, 4:31 PM
Copy code
const linkerdVizChart = new k8s.helm.v2.Chart("linkerd2-viz",
            {
                chart: "linkerd-viz",
                version: "2.10.2",
                namespace: "linkerd-viz",
                fetchOpts: {
                    repo: "<https://helm.linkerd.io/stable/>"
                },
                transformations: chartTransformations
            },
            {
                dependsOn: [ linkerdChart.ready ],
                parent: this,
            }
        );
b

billowy-army-68599

10/27/2021, 4:32 PM
that should do it
g

gray-city-50684

10/27/2021, 4:34 PM
I had a compile error with this, but then I figured out (reading a bug report answered by Luke):
dependsOn:  linkerdChart.ready
is working, or do an apply on ready and then I can add other dependencies too
❤️ 1
I will also take a look at helm.Release, thx for the help!