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

dazzling-sundown-39670

05/27/2020, 2:41 PM
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

billowy-army-68599

05/27/2020, 2:44 PM
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

dazzling-sundown-39670

05/27/2020, 2:53 PM
@billowy-army-68599 if I go with
helm repo add
I need to do it at my CD-server as well, right?
b

billowy-army-68599

05/27/2020, 2:55 PM
that's right
d

dazzling-sundown-39670

05/27/2020, 3:03 PM
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

billowy-army-68599

05/27/2020, 3:13 PM
you haven't specified a provider on the helm chart, so it's probably trying to install into a different cluster
d

dazzling-sundown-39670

05/27/2020, 3:18 PM
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

billowy-army-68599

05/27/2020, 3:28 PM
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

dazzling-sundown-39670

05/27/2020, 3:28 PM
🎉
Makes sense!
@billowy-army-68599 that works! Cheers!
2 Views