Skip to main content
Crossplane is where platform engineering becomes practical and powerful. It lets platform teams expose a simple Kubernetes API (for example, a Database resource) and have Crossplane provision and manage the underlying infrastructure on behalf of users. Consumers declare intent; the platform handles the implementation details. Key concepts:
  • 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.
In this lesson we will:
  1. Inspect the Crossplane control plane components.
  2. Review a Database XRD and its Composition.
  3. 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:
List the XRDs available:
Quick commands (useful references while following this demo):

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.
Here is the Database XRD used in this demo:
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 via compositeTypeRef.
Why this Composition matters:
  • The base resource is a Kubernetes Object (here a ConfigMap) which Crossplane will create in the target cluster and namespace.
  • patches copy fields from the composite spec into the provider/Kubernetes resource.
  • The map transform translates user-friendly choices (small, medium, large) into provider-specific instance classes.
Comparison: XRD vs Composition 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 named orders-db:
Apply it:
Check the composite instance:
Crossplane used the Composition to create a ConfigMap in the team-frontend namespace. Inspect the generated ConfigMap:
Observation:
  • The user specified size: large; the Composition mapped that to instanceClass: db.r5.large using a map transform. 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:
Apply it:
Check the composite and the generated ConfigMap:
Again, the 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 map let 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.
Next steps:
  • Open the Composition and explore additional transform types (e.g., string, fromCompositeFieldPath, math transforms).
  • Try adding or modifying transforms in the Composition to observe how they change the generated provider resources.

Watch Video

Practice Lab