I’m trying to add the `kube-prometheus-stack` Helm...
# kubernetes
a
I’m trying to add the
kube-prometheus-stack
Helm chart to my fairly vanilla EKS cluster. All managed by Pulumi. I’m getting this error:
Copy code
pulumi:pulumi:Stack (myproject-dev):
    error: Running program '/Users/jhamman/myproject/infrastructure/index.ts' failed with an unhandled exception:
    <ref *1> Error: invocation of kubernetes:helm:template returned an error: failed to generate YAML for specified Helm chart: failed to pull chart: invalid_reference: invalid tag
running
helm install prometheus prometheus-community/kube-prometheus-stack -n monitoring --version 66.3.1
seems to work but using the
k8s.helm.v3.Chart
Pulumi componet results in the error above. The Chart object is definted in the thread below. Thanks for any ideas or suggestions you might have.
Copy code
// Create a namespace for monitoring
const monitoringNamespace = new k8s.core.v1.Namespace("monitoring", {
  metadata: { name: "monitoring" },
}, { provider: cluster.provider });

// Deploy kube-prometheus-stack
const kubePrometheusStack = new k8s.helm.v3.Chart("kube-prometheus-stack", {
  chart: "kube-prometheus-stack",
  version: "66.3.1",
  fetchOpts: {
    repo: "<https://prometheus-community.github.io/helm-charts>",
  },
  namespace: monitoringNamespace.metadata.name,
  values: {
    grafana: {
      adminPassword: "foo12345",
      service: {
        type: "LoadBalancer",
      },
    },
  },
}, { provider: cluster.provider });
l
we use
Release
instead of
Chart
, not sure what the differences are between the two. This c# works as it should at least:
Copy code
PrometheusAgentRelease = new Release(appName, new ReleaseArgs
        {
            Name = appName,
            Namespace = appName,
            CreateNamespace = true,
            Chart = "kube-prometheus-stack",
            Version = "65.3.1",
            Values = agentValues,
            RepositoryOpts = new RepositoryOptsArgs
            {
                Repo = "<https://prometheus-community.github.io/helm-charts>",
            }
        }, new CustomResourceOptions
        {
            Provider = config.Provider,
        });
hm looks like "release" uses native helm commands to apply the resources, while "chart" renders the manifests, but then uses pulumi to manage them from there.
s
a
Thanks @stocky-restaurant-98004 - I’ve also tried this with the v4 chart and got the same result. Interestingly, before failing, Pulumi does report all the resources it plans to add. This indicates that it managed to integrate the chart into its plan. This makes me think the
invalid_reference: invalid tag
is a red herring of some sort.
s
Have you tried an
oci://
URI instead of
http://
?
That error is likely coming from Helm rather than Pulumi: https://github.com/helm/helm/issues/13466
a
I’ll give this a try, thanks.
s
LMK whether this fixes your problem - I'm curious. I'm guessing
helm install
defaults to OCI by now.
m
hey @astonishing-dress-81433, tried your code, not on EKS, and it works so far:
in your
index.ts
are you only installing the
kube-prometheus-stack
stack?
a
Yes, we have other helm charts that we are installing beyond this one
m
I think it maybe not related to this particular helm chart?