https://pulumi.com logo
Title
v

victorious-continent-984

04/11/2022, 8:32 AM
Hi, Pulumi Team. Wonderful tool, had fun exploring it’s abilities. Struggled with the helm chart installation, specifically kube-prometheus-stack. Following code fails to create entities based on CRD’s, I guess chart doesn’t install them.
from pulumi_kubernetes.helm.v3 import Chart, ChartOpts, FetchOpts

# ...

def remove_status(obj, opts):
    if obj["kind"] == "CustomResourceDefinition":
        del obj["status"]

prometheus_stack_chart = Chart(
    "prometheus-stack",
    ChartOpts(
        chart="kube-prometheus-stack",
        transformations=[remove_status],
        version="34.8.0",
        fetch_opts=FetchOpts(
            repo="<https://prometheus-community.github.io/helm-charts>",
        ),
        namespace=monitoring_namespace.id,
        values=values,
        skip_await=False
    ),
    pulumi.ResourceOptions(depends_on=[monitoring_namespace, cluster])
)
I may notice the
remove_status
hack (I’ve found on the Internet), without it installation fails before the beginning, ’cause somewhere inside it tries to pass that
status
argument to a function that doesn’t expect it. Am I doing something wrong, or am I just unlucky to need the Chart that is trouble to install with pulumi? Do you have any ideas or suggestions?
p

prehistoric-activity-61023

04/11/2022, 8:36 AM
Can you confirm that CRD are not installed once the following code is executed?
v

victorious-continent-984

04/11/2022, 9:02 AM
Yes, they were partially installed. I saw only one out of 8.
p

prehistoric-activity-61023

04/11/2022, 9:21 AM
I see. I’ll try to repro it on my side but I’m pretty swamped with work today.
🙏 1
g

great-sunset-355

04/14/2022, 12:48 PM
I had some problems with a chart that required helm hooks and the solution was to use
pulumi_kubernetes.helm.v3.Release
instead of
Chart
1
p

prehistoric-activity-61023

04/14/2022, 1:06 PM
@great-sunset-355 might be on to something. I remember now that pulumi provided (later) a dedicated support for helm releases. That differs a lot compared to the Chart resource that basically renders the helm chart and applies the generated manifests one by one (without creating a helm release).
v

victorious-continent-984

04/14/2022, 1:17 PM
hm, thanks a lot, I’ll try to use
Release
p

polite-night-3633

07/25/2022, 6:52 AM
@victorious-continent-984 any success with the
HelmRelease
approach? I'm running into the following problem:
Use Helm CLI to investigate.: failed to become available within allocated timeout. Error: Helm Release monitoring/kube-prometheus: unable to build kubernetes objects from new release manifest: unable to recognize "":
my code:
new k8s.helm.v3.Release(
      `${name}-kube-prometheus`,
      {
        chart: 'kube-prometheus-stack',
        version: '37.3.0',
        namespace: this.namespace,
        createNamespace: false,
        skipCrds: true,
        repositoryOpts: { repo: '<https://prometheus-community.github.io/helm-charts>' },
      },
      { ...this.OPTS, dependsOn: namespace },
    );
I was trying to play with the
skipAwait
flag but it doesn't change the result. CRDs are all installed correctly. Also setting a
name
for the
HelmRelease
didn't change anything. Any ideas?
v

victorious-continent-984

07/25/2022, 7:58 AM
Release resource worked fine for me. Some times it’s better to remove the helm release with CLI and create it again with pulumi.
And if I’m not mistaken
dependsOn
should be an array
And that there’s proper k8s provider set within opts
p

polite-night-3633

07/28/2022, 12:01 PM
I will try again with a clean state - regarding the
dependsOn
key: documentation allows both array and single item values
/**
     * An optional additional explicit dependencies on other resources.
     */
    dependsOn?: Input<Input<Resource>[]> | Input<Resource>;
the k8s provider is set within the
this.OPTS
object and also works fine for any other kubernetes resource I'm spinning up using pulumi