-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Develop Component resource for: kubernetes:apiextensions.k8s.io:CustomResource #2787
Comments
I was curious as to why Pulumi YAML is unable to simply use the For example, given a YAML program: resources:
myCustomResource:
type: kubernetes:apiextensions.k8s.io:CustomResource
properties:
apiVersion: stable.example.com/v1
kind: CronTab
metadata:
name: my-new-cron-object
spec:
cronSpec: "* * * * */5" The YAML engine obtains schema info from the provider, and is unable to handle the
Here's the schema for At the SDK level, the overlay types are defined in a way that Pulumi schema cannot represent, e.g. the special export interface CustomResourceArgs {
apiVersion: pulumi.Input<string>;
kind: pulumi.Input<string>;
metadata?: pulumi.Input<inputs.meta.v1.ObjectMeta>;
[othersFields: string]: pulumi.Input<any>;
} The SDK simply disregards the underlying schema. In other words, the SDKs emulate support for open-ended schemas, and take advantage of the fact that inputs aren't validated against the schema by the engine. |
We chose to address the use-case behind this issue in a limited way, by implementing For the Pulumi YAML SDK, it isn't practical to provide an implementation at this time. Please consider using the |
This issue has been addressed in PR #3020 and shipped in release v4.13.1. |
CustomResource
is a generic resource for creating a Kubernetes custom resource; see example. Today it is implemented as an 'overlay' resource and has two major limitations:Conceptually,
CustomResource
represents a single Kubernetes object akin toConfigMap
orDeployment
. It's not a component resource and should continue to benefit from the usual resource lifecycle (e.g. diff).For most use-cases, a reasonable alternative to
CustomResource
isConfigGroup
with itsobjs
input property, which allows for literal Kubernetes objects. That said, a component resource is an awkward substitute for a custom resource.Note that the Pulumi Converter for Kubernetes (kube2pulumi and pulumi-converter-kubernetes) doesn't support custom resources (see Limitations).
Resolves
The text was updated successfully, but these errors were encountered: