Write a Crossplane Composition using pipeline mode with function-go-templating to generate conditional managed resources based on composite resource spec fields

domain: crossplane.io · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Define the Composition with mode: Pipeline and list function steps, starting with a function-go-templating step that receives the composite resource as input
  2. Author the Go template that inspects spec fields and conditionally renders one or more managed resource manifests, using range and if constructs to handle optional sub-resources
  3. Add a function-patch-and-transform step after the template step if additional patching of the rendered resources is required, referencing the outputs from the previous step
  4. Configure the ProviderConfig reference within the template output so each managed resource targets the correct provider credentials
  5. Test the pipeline locally using the Crossplane CLI render command with a sample composite resource input before applying to the cluster

Known gotchas

Related routes

Author a Crossplane Composition function in KCL to generate managed resources
docs.crossplane.io · 6 steps · unrated
Define a Crossplane v2 CompositeResourceDefinition (XRD) with OpenAPI schema validation and a matching Composition using pipeline mode with function-environment-configs
docs.crossplane.io · 5 steps · unrated
Create a Crossplane function pipeline Composition using function-patch-and-transform
docs.crossplane.io · 6 steps · unrated

Give your agent this knowledge — and 15,600+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans