feat: Template CRD for Dynamic API Generation (kro-style) #1087
+34,192
−137
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces the Template CRD, a powerful new feature that brings kro-style dynamic CRD generation to the Pulumi Kubernetes Operator. It enables platform engineers to define custom Kubernetes APIs backed by Pulumi infrastructure without writing any controller code.
What is this?
Think of it as Crossplane Compositions meets kro meets Pulumi:
Key Features
TemplateCR, and the operator automatically generates and registers a new CRD${schema.spec.X}substitution with fallback support (${schema.spec.name || schema.metadata.name})packagesfielddestroyOnDelete: trueExample
Define a Template:
Users can then create instances:
The operator handles everything: creating the Program CR, Stack CR, managing the Pulumi workspace, and syncing outputs back to the instance status.
Files Changed
operator/api/pulumi/v1alpha1/template_types.gooperator/internal/controller/pulumi/template_controller.gooperator/internal/controller/pulumi/metrics_template.goTest Plan
make test)destroyOnDeletecleanup works correctly