Using `@pulumi/kubernetes/helm/v2`, how do I add a...
# general
d
Using
@pulumi/kubernetes/helm/v2
, how do I add another repo? Using helm I would run
helm repo add jetstack <https://charts.jetstack.io>
for example
b
there's two different ways 1: if you do
helm repo add
like you suggest the kubernetes provider will use that to fetch the chart 2: you can use
FetchOpts
to specify the url for the chart: https://www.pulumi.com/docs/reference/pkg/nodejs/pulumi/kubernetes/helm/v2/#FetchOpts
👍 1
d
@billowy-army-68599 if I go with
helm repo add
I need to do it at my CD-server as well, right?
b
that's right
d
Thanks!
I'm getting
namespaces "cert-manager" not found
even though I have dependency on that namespace.
Copy code
export const certManagerNamespace = new k8s.core.v1.Namespace(
  'cert-manager',
  undefined,
  { provider: cluster.provider },
);

export const certManager = new k8s.helm.v2.Chart(
  'cert-manager',
  {
    chart: 'cert-manager',
    version: 'v0.15.1',
    namespace: 'cert-manager',
    values: {
      installCRDs: true,
    },
    fetchOpts: {
      repo: '<https://charts.jetstack.io>',
    },
  },
  {
    dependsOn: certManagerNamespace,
  },
);
Any suggestions?
b
you haven't specified a provider on the helm chart, so it's probably trying to install into a different cluster
d
Ah! 🤦‍♂️
Thanks!
@billowy-army-68599 I added provider to the Chart but I'm still seeing the same error
I guess I should do this?
namespace: certManagerNamespace.id,
b
ah, the k8s provider will generate random strings for resource names by default, you probably want this:
Copy code
const namespace = new k8s.core.v1.Namespace("cert-manager", {
    metadata: {
        name: `cert-manager`,
    }
}, { provider: provider });
Copy code
export const certManager = new k8s.helm.v2.Chart(
  'cert-manager',
  {
    chart: 'cert-manager',
    version: 'v0.15.1',
    namespace: namespace.metadata.name,
    values: {
      installCRDs: true,
    },
    fetchOpts: {
      repo: '<https://charts.jetstack.io>',
    },
  },
  {
    dependsOn: certManagerNamespace,
  },
);
(that hasn't been tested, but hopefully you get the idea)
d
🎉
Makes sense!
@billowy-army-68599 that works! Cheers!