Hey there! Posting my questions here because I thi...
# kubernetes
a
Hey there! Posting my questions here because I think they are most relevant here, but if I should move this to another channel that's better suited, then let me know. I am building a component resource provider, in Go, for easily deploying my company’s platform, which is a cloud environment, such as a VPC and EKS cluster, with a suite of open-source tools that gets deployed to Kubernetes. I’ve ran into a dilemma and I’m not sure how to proceed. I’m trying to make use of the Kubernetes provider’s “CustomResource” resource in order to configure an ArgoCD application custom resource. I’ve hit a snag with that "CustomResource" resource type because one of its arguments doesn't implement Pulumi types, specifically the
OtherFields
field, ref. Because of that, I can’t pass it a Pulumi type for a value. This is an issue for me because my custom resource needs to support resource dependencies for a
dependsOn
to work, but as far as I know Pulumi’s provider type checking requires that fields implement Pulumi types if a resource is to have dependencies. Implementing plain types when my provider’s resource has a
dependsOn
results in an error like the following:
Copy code
error: program failed: waiting for RPCs: rpc error: code = Unknown desc = setting args: copying input "spec": application.ArgocdAppArgs.Spec is typed as map[string]interface {} but must be a type that implements pulumi.Input or pulumi.Output for input with dependencies
Which seems to originate from here: https://github.com/pulumi/pulumi/blob/master/sdk/go/pulumi/provider.go#L564. Which seems odd that this is even a problem, because my dependency is simply a
dependsOn
, not an actual field dependency. So with all of that backstory laid out, my main questions are: How do I pass a pulumi type to a resource that implements a plain type? If that’s not possible, is it possible to get around the pulumi provider type checking that is requiring all fields to implement pulumi types when there are dependencies?
this is quite the novel, I apologies for the information overload 😅 but I felt it was necessary to explain what I was doing to understand why I have the problems that I have.
Thanks in advance to anyone that reads this 🙏
b
You might want to check https://github.com/pulumi/crd2pulumi, we've been using it a lot, for example deploying prometheus and alert manager using prometheus operator
a
Thanks for the link! That seems like it would solve my custom resource problem, I'll try that out today
👍 1
b
Your end goal is to create argocd applications in the target cluster, correct? Have you considered using Kustomize? You can just reference a remote
raw.githubusercontent
url and have it apply that. https://www.pulumi.com/registry/packages/kubernetes/api-docs/kustomize/directory/