How do you avoid URN duplication when deploying 2 ...
# kubernetes
b
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
you can set the resource to be a parent of another resource
so the urn's will be different
b
hmmm, example? /me googling
r
which language is being used for pulumi?
I can show an example then
b
typescript
r
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
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
const kongGatewayDP = new k8s.helm.v3.Chart("dataplane",{chart: "foo",skipCRDRendering: true}, {parent: ns})
🤯 1
you could skip them
b
that got messy fast https://termbin.com/7mbt
perhapse I can remove the child resources, then re-deploy them but without the crds
r
try deleting and re-creating from start
b
yep, doing
Copy code
parent: kongGatewayCP,
Copy code
skipCRDRendering: true,
These two lines of magic from you made my week. Thank you!!
👍 1
102 Views