- XRD (CompositeResourceDefinition) — defines the user-facing API and which fields users can set.
- Composition — implements the XRD by creating provider or Kubernetes resources and applying patches/transforms.
- Inspect the Crossplane control plane components.
- Review a Database XRD and its Composition.
- Create two example Database composite resources and show how inputs are transformed into provider or Kubernetes resources.
What is running in the control plane
Check the Crossplane controllers, the RBAC manager, the patch-and-transform function and the Kubernetes provider:Inspect the XRD
An XRD (CompositeResourceDefinition) looks similar to a CRD. It defines:- the composite’s API group and kind,
- its scope (Namespaced or Cluster),
- and the openAPI schema for the user-facing
spec.
The
scope controls where composite instances live. Namespaced means users create Database resources in a namespace (and RBAC applies at namespace level). Cluster scope makes them cluster-wide. Choose scope deliberately to match your platform UX and RBAC model.Inspect the Composition
Compositions map a composite type (the XRD) to concrete provider or Kubernetes resources. This example uses a pipeline Composition with a function that applies patches and transformations. The Composition is bound to the Database XRD viacompositeTypeRef.
- The
baseresource is a Kubernetes Object (here a ConfigMap) which Crossplane will create in the target cluster and namespace. patchescopy fields from the compositespecinto the provider/Kubernetes resource.- The
maptransform translates user-friendly choices (small,medium,large) into provider-specific instance classes.
We will now demonstrate two user-facing Database resources and observe what Crossplane creates.
Example 1 — orders-db (postgresql, large)
User creates a Database composite resource namedorders-db:
team-frontend namespace. Inspect the generated ConfigMap:
- The user specified
size: large; the Composition mapped that toinstanceClass: db.r5.largeusing amaptransform. The platform handled provider-specific details, so the user didn’t need to know the exact instance class name.
Example 2 — small-db (mysql, small)
Create a second Database with smaller size and a different target namespace:size: small value from the composite was translated to db.t3.micro in the generated ConfigMap by the Composition’s map transform.
To diagnose Crossplane-managed resources, inspect resource conditions first. Use
kubectl describe (for example, kubectl describe database orders-db) and review the .status.conditions fields. Synced and Ready follow the same operator-style condition patterns used by Kubernetes controllers.Summary
- XRDs define the user-facing API and schema; Compositions implement that API by provisioning provider or Kubernetes resources.
- Patches and transforms in Compositions allow platform authors to expose simple, user-friendly fields while mapping them to provider-specific configuration.
- Transform types like
maplet platform authors present meaningful choices (small/medium/large) and translate these to concrete provider settings (db.t3.micro,db.t3.medium,db.r5.large). - Users declare high-level intent (engine, size, environment, targetNamespace); Crossplane translates that intent into real resources in the correct namespaces with provider-specific values.
- Open the Composition and explore additional transform types (e.g.,
string,fromCompositeFieldPath,mathtransforms). - Try adding or modifying transforms in the Composition to observe how they change the generated provider resources.
Links and references
- Crossplane Documentation
- Crossplane Composition transforms reference (search for transforms and functions)
- Kubernetes documentation - CustomResourceDefinitions