https://pulumi.com logo
f

famous-kite-69533

03/23/2020, 12:10 PM
Hi, I am trying to install the Velero Helm chart, which is compatible with Helm v2 but not v3. So I am trying to install it with
k8s.helm.v2.Chart(...)
but even with v2 Pulumi gives me
skipping unknown hook: "crd-install"
. How can I ensure the CRDs are installed? I can't find a setting or something like that in the docs. Thanks!
👍 1
From this page https://github.com/pulumi/pulumi-kubernetes/issues/954 it seems that Pulumi uses whichever Helm binary I have. I have Helm 3... can I somehow specify the name of the binary/helm command so that I can keep both v2 and v3 (v3 named "helm" and v2 named "helm2" since I use v3 by default?)
a

acoustic-leather-88378

03/23/2020, 12:25 PM
@famous-kite-69533 the problem with CRD's, Charts and Pulumi is that since the
Chart
resource basically just does a
helm template
(see https://github.com/pulumi/pulumi-kubernetes/blob/de362a8aa0a039257d6d8235f379c11559ee5cf1/pkg/gen/nodejs-templates/helm/v2/helm.ts#L121), the CRD hook never actually runs. I.e.
helm install
is never really called/used... The warning message is therefore sort of expected. I had to get around this by installing the local CRD's (after unpacking the chart) manually before installing the Chart. Although, I am also just starting out, so perhaps there is a better way...
f

famous-kite-69533

03/23/2020, 12:27 PM
Thanks @acoustic-leather-88378. I was hoping this would work out of the box.... so what do you suggest I do with Velero?
How do you unpack the chart locally and install the crds before the chart?
a

acoustic-leather-88378

03/23/2020, 12:28 PM
f

famous-kite-69533

03/23/2020, 12:29 PM
You are awesome 😄 The Zalando operator is on my list of things to figure out with Pulumi 😄
👍 1
a

acoustic-leather-88378

03/23/2020, 12:32 PM
The default fetch location seems to be in the current directory (https://github.com/pulumi/pulumi-kubernetes/blob/master/pkg/gen/nodejs-templates/helm/v2/helm.ts#L276), so you should be able to just reference the CRD's with:
Copy code
// Install the CRD's manually
    new k8s.yaml.ConfigGroup("postgres-operator-crds", {
        files: [nodepath.join("<name of chart>/crds", "*.yaml")],
    });
or something similar. Directory is cleaned up afterwards...
f

famous-kite-69533

03/23/2020, 12:42 PM
Uhm how can I find the URL of the chart to download knowing the repo URL and the version?
<https://vmware-tanzu.github.io/helm-charts/velero/velero-2.9.4.tgz>
gives me a not found
<https://vmware-tanzu.github.io/helm-charts>
is the repo,
velero
is the chart and
2.9.4
is the version
nevermind, I'm stupid 😄
I had an unrelated issue but I got Velero install working perfectly now. Thanks a lot for your help! @acoustic-leather-88378
a

acoustic-leather-88378

03/23/2020, 3:29 PM
Awesome, no problem! 👍
f

famous-kite-69533

03/25/2020, 6:57 PM
Hi @acoustic-leather-88378! I am looking into the Zalando operator now. In the code you kindly shared with me you are using a function named
crdValues
to load the values file. However I would like to override some of those settings (such as for logical backups), so I would like to merge the values-crd.yaml file and my custom settings. How can I do that? I am totally new to Typescript and I am fighting with it 😄
I think I got it
a

acoustic-leather-88378

03/25/2020, 7:17 PM
@famous-kite-69533 the
crdValues
just create the CRD's definitions here https://github.com/zalando/postgres-operator/tree/master/charts/postgres-operator/crds They should not be modified
f

famous-kite-69533

03/25/2020, 7:18 PM
But I need to customise some settings, like the ones for the logical backups - s3 credentials, bucket, region, endpoint, schedule
a

acoustic-leather-88378

03/25/2020, 7:18 PM
Oh wait, ok I see 🙂 yes, so that method just makes loading the Helm equivalent of
helm template --values values-crd.yml
(see https://github.com/zalando/postgres-operator/blob/master/charts/postgres-operator/values-crd.yaml)
f

famous-kite-69533

03/25/2020, 7:19 PM
When I install manually, I edit the values-crd.yaml file
a

acoustic-leather-88378

03/25/2020, 7:19 PM
I got confused with the actual CRD's and the name of the values file 👍
f

famous-kite-69533

03/25/2020, 7:19 PM
Okies. The problem is that Pulumi seems to load values.yaml anyway
Is it possible to disable that?
a

acoustic-leather-88378

03/25/2020, 7:20 PM
You can just copy the
values-crd.yml
in your current directory or a directory within your Pulumi program and make the necessary changes and then use that file in that method
f

famous-kite-69533

03/25/2020, 7:20 PM
I am getting errors that I think are related to the fact that it's loading the configuration for the ConfigMap mode, together with the values-crd and my settings
Sorry, which method? 😄 Do you mean crdValues?
👍 1
I am trying to make the code reusable, so ideally I don't want to have to edit any files manually. So I am using args and Pulumi config
a

acoustic-leather-88378

03/25/2020, 7:22 PM
f

famous-kite-69533

03/25/2020, 7:22 PM
Ah
Should I just overwrite it with the contents of values-crd.yaml, using something like shelljs?
a

acoustic-leather-88378

03/25/2020, 7:23 PM
So you would have to override anything that's causing issues
f

famous-kite-69533

03/25/2020, 7:23 PM
I see
I think it's complaining about the strings which should be booleans
I will try specifying those in my config
a

acoustic-leather-88378

03/25/2020, 7:24 PM
That's the only way I see at the moment. I might have better insights tomorrow, also need to change a few things related to logical backups etc.
👍 I'll let you know
f

famous-kite-69533

03/25/2020, 7:24 PM
Oh hold on 😄 But since I am merging the values-crd.yaml settings with my custom settings, those should override the values.yaml loaded automatically, I think?
👍 1
a

acoustic-leather-88378

03/25/2020, 7:25 PM
Yes, that should
f

famous-kite-69533

03/25/2020, 7:25 PM
Ok
Weird
Would be great if you could give it a try and let me know 🙂
a

acoustic-leather-88378

03/25/2020, 7:25 PM
👍
f

famous-kite-69533

03/25/2020, 7:32 PM
OK. For now I am trying to set the values it's complaining about explicitly
👍 1
let's see...
2 Views