https://pulumi.com logo
Title
p

prehistoric-sandwich-7272

11/03/2022, 1:03 PM
Hello, I have a problem with
crd2pulumi
- I have generated from the following crd - https://github.com/argoproj/argo-helm/blob/main/charts/argo-rollouts/templates/crds/rollout-crd.yaml a pulumi package using the above command, and I got errors in the pulumiTypes.go file! When I am running pulumi up, I get the following error message:
argoRollout/argoproj/v1alpha1/pulumiTypes.go:1842:6: RolloutSpecStrategyBluegreenPostpromotionanalysisArgs redeclared in this block
argoRollout/argoproj/v1alpha1/pulumiTypes.go:1674:6: other declaration of RolloutSpecStrategyBluegreenPostpromotionanalysisArgs
argoRollout/argoproj/v1alpha1/pulumiTypes.go:1917:98: v.Name undefined (type RolloutSpecStrategyBluegreenPostpromotionanalysisArgs has no field or method Name)
.
.
.
argoRollout/argoproj/v1alpha1/pulumiTypes.go:2798:98: too many errors
I am taking from this that the
crd2pulumi
couldn’t create the package from the crd correctly. Is there any way around this?
b

billowy-army-68599

11/03/2022, 1:13 PM
please file an issue
l

limited-rainbow-51650

11/03/2022, 1:31 PM
@prehistoric-sandwich-7272 for which language do you want the generated types representing the Argo CRD? The Pulumiverse community has a setup working and published packages already. Source: https://github.com/pulumiverse/kubernetes-sdks/blob/main/sdks.yaml#L1-L5
And if that doesn’t contain the CRDs you need, can you retry
crd2pulumi
with the CRDs here: https://github.com/argoproj/argo-rollouts/tree/master/manifests/crds
crd2pulumi
doesn’t work with Helm charts FYI.
p

prehistoric-sandwich-7272

11/03/2022, 1:39 PM
@limited-rainbow-51650 I specifically need the argo-rollout crd, looks like it’s not on https://github.com/pulumiverse/kubernetes-sdks/blob/main/sdks.yaml#L1-L5 (there is only argo-cd here) And yes, I have tried with the corresponding crd (not a helm chart) - https://github.com/argoproj/argo-rollouts/blob/master/manifests/crds/rollout-crd.yaml
I opened an issue, thanks - https://github.com/pulumi/crd2pulumi/issues/104 @billowy-army-68599
l

limited-rainbow-51650

11/03/2022, 2:12 PM
@prehistoric-sandwich-7272 did it work with the non-Helm CRD? If not, can you update your ticket to use the non-Helm URL? This is to prevent that one of our engineers would close the ticket with the remark that
crd2pulumi
doesn’t support Helm charts.
p

prehistoric-sandwich-7272

11/03/2022, 2:19 PM
@limited-rainbow-51650 Yes the url was wrong, updated it to the crd yaml I have tried with. thanks !
@limited-rainbow-51650 @billowy-army-68599 Hey guys - regarding this question Do you have any suggestions on how should I deploy rollouts until this will be fixed? Any way to deploy this crd without ‘crd2pulumi’ ?
l

limited-rainbow-51650

11/22/2022, 4:01 PM
@prehistoric-sandwich-7272 as a workaround, can you see if the Helm Chart support of our Kubernetes provider works for you, directly using the argo rollouts helm chart? https://www.pulumi.com/registry/packages/kubernetes/api-docs/helm/v3/chart/
p

prehistoric-sandwich-7272

11/22/2022, 4:18 PM
@limited-rainbow-51650 But can I install the ‘Rollout’ resource - or any custom resource for that matter, via new chart? I installed argo-rollouts chart already, and I need to create a ‘Rollout’ resource, from my understanding I need the pulumi equivalent of this step - https://argoproj.github.io/argo-rollouts/#quick-start
they are doing ‘kubectl apply’ on a custom resource definition
l

limited-rainbow-51650

11/22/2022, 4:30 PM
The counterpart for
kubectl apply
of a single YAML file is this Pulumi Kubernetes resource: https://www.pulumi.com/registry/packages/kubernetes/api-docs/yaml/configfile/
b

billowy-army-68599

11/22/2022, 4:36 PM
if you just want to create a rollout, you can define the shape using CustomResource https://www.pulumi.com/registry/packages/kubernetes/api-docs/apiextensions/customresource/
p

prehistoric-sandwich-7272

11/22/2022, 4:49 PM
@billowy-army-68599 looks good my crd is pretty long yaml file(14,000+ lines) - on typescript I could have done something like converting yaml to json and paste it in the new crd function - I am writing it in Golang though - any convertor or a quick way of doing it instead of writing each type manually?
I started doing manually it but it doesn’t look practical:
b

billowy-army-68599

11/22/2022, 4:52 PM
if you’re defining the custom resource definition I’d just use the ConfigFile file mechanism Ringo suggested
crd2pulumi doesn’t handle that for you anyway, just use the ConfigFile install
p

prehistoric-sandwich-7272

11/22/2022, 5:01 PM
@billowy-army-68599 ok I will give it a go, thanks ! 🙂