https://pulumi.com logo
Title
s

salmon-musician-36333

04/23/2023, 5:57 PM
Hey folks, I'm hoping to use Pulumi to deploy an EKS cluster and install a bunch Helm charts on it all in one go. I'm trying to use
@pulumi/kubernetes
helm.v3.Chart
and
@pulumi/eks
Cluster
for this purpose. Looking at the docs, I'm not seeing a way that I can pass the
Cluster
to
helm.v3.Chart
, rather that it will be running the chart against whatever cluster is
helm
default on my system at the time. Is there a way to point it at the cluster I've just created without having to first set up the EKS cluster, then make it default in my shell, and then run the charts deploy? PS One of the charts I want to deploy is the AWS EFS CSI driver, going by the note on https://www.pulumi.com/blog/persisting-kubernetes-workloads-with-amazon-efscsi-volumes-using-pulumi-sdks/ that it's recommended to use the sigs chart for this. Is that still the case?
b

billowy-army-68599

04/23/2023, 6:01 PM
You need to define a provider and then pass that provider to your helm chart. There are examples in this repo https://github.com/pulumi/examples Search for Chart in your language of choice
If you’re struggling to find them, let me know which languages you’re using and I can find one
s

salmon-musician-36333

04/23/2023, 6:16 PM
Thanks, let me take a look.
Ok, so I've been using TS, but I took a look at the C# example as well. I've seen the K8s provider somewhere before, but didn't see anything in the examples that spins up a cluster and applies the charts in the same deployment script. Can you recommend an example?
Hey mate, think I found an example for the
helm.v2.Chart
that will work for
v3
as well: https://github.com/pulumi/pulumi-kubernetes
Weirdly, though, even though I have now
{
    providers: { kubernetes: eksCluster.provider },
    dependsOn: [eksCluster, istioIngress],
  },
It doesn't seem to be waiting for the cluster to come up, and is erroring out trying to get the k8s server version.
I'm getting a bunch of this:
error: Error: invocation of kubernetes:helm:template returned an error: failed to generate YAML for specified Helm chart: could not get server version from Kubernetes: Get "...": x509: certificate is not valid for any names, but wanted to match ...