https://pulumi.com logo
b

busy-journalist-6936

08/13/2021, 2:58 PM
How do you avoid URN duplication when deploying 2 of the same helm charts on a single cluster? THESE are my current
k8s.helm.v3.chart
snippets. It seems like I may need to learn how the aliases work due to URN collision as I'm getting the following error:
Copy code
Diagnostics:
      kubernetes:<http://apiextensions.k8s.io/v1:CustomResourceDefinition|apiextensions.k8s.io/v1:CustomResourceDefinition> (<http://kongplugins.configuration.konghq.com|kongplugins.configuration.konghq.com>):
        error: Duplicate resource URN 'urn:pulumi:KongHybridGatewayOnEKS::Gateway::kubernetes:<http://helm.sh/v3:Chart$kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition::kongplugins.configuration.konghq.com';|helm.sh/v3:Chart$kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition::kongplugins.configuration.konghq.com';> try giving it a unique name
r

rough-farmer-61054

08/13/2021, 5:02 PM
you can set the resource to be a parent of another resource
so the urn's will be different
b

busy-journalist-6936

08/13/2021, 5:07 PM
hmmm, example? /me googling
r

rough-farmer-61054

08/13/2021, 5:09 PM
which language is being used for pulumi?
I can show an example then
b

busy-journalist-6936

08/13/2021, 5:13 PM
typescript
r

rough-farmer-61054

08/13/2021, 5:18 PM
Copy code
import * as k8s from "@pulumi/kubernetes";

const ns = new k8s.core.v1.Namespace("ns")

const kongGatewayDP = new k8s.helm.v3.Chart("dataplane",{chart: "foo"}, {parent: ns})
b

busy-journalist-6936

08/13/2021, 5:20 PM
Interesting, giving that a shot
🤞 1
Seems to have worked. I'm still getting attempted duplicate CRD creation but I think I can do a PR against the helm chart repo to fix that (i think)
💪 1
starting new thread, looks like
--include-crds
is forced at the pulumi level
r

rough-farmer-61054

08/13/2021, 8:20 PM
const kongGatewayDP = new k8s.helm.v3.Chart("dataplane",{chart: "foo",skipCRDRendering: true}, {parent: ns})
🤯 1
you could skip them
b

busy-journalist-6936

08/13/2021, 8:29 PM
that got messy fast https://termbin.com/7mbt
perhapse I can remove the child resources, then re-deploy them but without the crds
r

rough-farmer-61054

08/13/2021, 8:31 PM
try deleting and re-creating from start
b

busy-journalist-6936

08/13/2021, 8:31 PM
yep, doing
Copy code
parent: kongGatewayCP,
Copy code
skipCRDRendering: true,
These two lines of magic from you made my week. Thank you!!
👍 1
16 Views