Crossplane is the control-plane way to build the abstraction from section 3.1. You define a new API (XRD), write the recipe that expands it into real resources (Composition), and developers create instances (XR) that reconcile continuously like any operator-managed object.

needsmake up api

Orientation

competency 3.4 · automation frameworks for self-service

The three files in examples/crossplane/ form one complete platform API: AppEnvironment goes in, and a namespace plus quota come out. Read them in order (XRD → Composition → XR) and the whole model clicks into place.

The one-line model

XRD = the API you promise (schema and names). Composition = the recipe that fulfills it (a pipeline of functions producing composed resources). XR = an instance a developer creates. Crossplane generates the CRD from your XRD, then reconciles every XR by running the composition and applying the result. It keeps running forever, so any drift on the composed resources gets reverted just like any other controller.

The v2 model, because versions matter here

what changed, and why online examples mislead

This lab runs Crossplane v2, and the differences from the v1 tutorials you'll find online are the exact things that'll trip you up:

Topicv1 (most tutorials)v2 (this lab)
ScopeXRs are cluster-scopedXRs can be namespaced (spec.scope: Namespaced in the XRD)
Developer-facing objectA Claim (namespaced) pointing to a cluster XRNo claims for v2 scopes: developers create the XR directly (scope: LegacyCluster keeps claim behavior for migrating v1 APIs)
Composition styleInline resources[] with patch listsmode: Pipeline, an ordered list of functions
When docs and the cluster disagree, the cluster wins

kubectl explain composition.spec settles the dialect question in three seconds. Building that reflex pays off far more than memorizing either version, because every fast-moving tool in this curriculum will hand you version skew eventually.

Walk the chain in the files

  • xrd.yaml defines the schema and names for AppEnvironment, generating the CRD you inspected back in 3.2. It's the exact same OpenAPI schema you hand-wrote there, which is the payoff for doing 3.2 first.
  • composition.yaml points compositeTypeRef back at that kind and defines a pipeline. First, function-patch-and-transform renders two provider-kubernetes Objects, one wrapping a Namespace and one a ResourceQuota. FromCompositeFieldPath patches copy spec.team and the quota fields from the XR, while a ToCompositeFieldPath patch writes the namespace name back into XR status. Next, function-auto-ready marks the XR Ready once all of its composed resources report Ready.
  • xr.yaml is the ten-line developer experience all that machinery buys.
XRD AppEnvironment ──generates──▶ CRD appenvironments.platform.lab.local
                                                    ▲
XR team-c-dev  spec: {team, cpuQuota, memoryQuota} ─┘
   │  reconciled by Crossplane through…
   ▼
Composition (mode: Pipeline)
   ├─ function-patch-and-transform ─▶ Object/ns    → Namespace team-c
   │                                  Object/quota → ResourceQuota tenant-quota
   └─ function-auto-ready ──────────▶ XR Ready when composed resources are Ready

Providers, functions, and package health

Crossplane extends itself through packages: Providers (controllers for external APIs like AWS, GCP, Kubernetes, or Helm) and Functions (the pipeline steps that render composed resources). A ProviderConfig or ClusterProviderConfig tells each provider how to authenticate.

Step zero of any Crossplane diagnosis: run kubectl get providers.pkg.crossplane.io,functions.pkg.crossplane.io. Every package must be Installed and Healthy before anything downstream can succeed. When a composition calls a function that never came up, the XR just stalls with a vague message. Spending thirty seconds on package health saves twenty minutes of staring at manifests.

Two gotchas the lab already paid for
  1. A namespaced XR can't own cluster-scoped resources (Kubernetes ownerReferences forbid it), so the composition uses the namespaced Object variant (kubernetes.m.crossplane.io, not kubernetes.crossplane.io) even though the manifest inside it is a cluster-scoped Namespace. If you pick the wrong variant, you'll see cannot apply cluster scoped composed resource.
  2. That namespaced variant authenticates through ClusterProviderConfig, not ProviderConfig. Almost the same name, different kind, and the error looks like an auth problem rather than a schema mistake.

Spotting those two errors on sight will save you real time on the exam.

Operating a Crossplane platform API

read paths and failure bubbles

Failures bubble bottom-up: a composed resource breaks, its condition explains why, the XR's Ready flips to False with a brief summary, and the developer only sees the XR. So every Crossplane investigation follows the same read path: XR conditions → composed resource conditions → the underlying object's actual error.

crossplane resource trace appenvironment team-c-dev    # the whole tree with statuses, one shot
kubectl get appenvironment team-c-dev -o jsonpath='{.status.conditions}' | jq
kubectl -n default get objects.kubernetes.m.crossplane.io -o yaml | grep -A3 message
kubectl get providers.pkg.crossplane.io,functions.pkg.crossplane.io
outputcaptured 2026-08-26
$ crossplane resource trace appenvironment team-c-dev    # the whole tree with statuses, one shot
NAME                                          SYNCED   READY   STATUS
AppEnvironment/team-c-dev (default)           True     True    Available
├─ Object/team-c-dev-b4bcdb64391c (default)   True     True    Available
└─ Object/team-c-dev-e7e1d26b0016 (default)   True     True    Available
$ kubectl get appenvironment team-c-dev -o jsonpath='{.status.conditions}' | jq
[
  {
    "lastTransitionTime": "2026-08-27T01:53:00Z",
    "observedGeneration": 4,
    "reason": "ReconcileSuccess",
    "status": "True",
    "type": "Synced"
  },
  {
    "lastTransitionTime": "2026-08-27T01:53:06Z",
    "observedGeneration": 4,
    "reason": "Available",
    "status": "True",
    "type": "Ready"
  },
  {
    "lastTransitionTime": "2026-08-27T01:53:00Z",
    "observedGeneration": 4,
    "reason": "WatchCircuitClosed",
    "status": "True",
    "type": "Responsive"
  }
]
$ kubectl -n default get objects.kubernetes.m.crossplane.io -o yaml | grep -A3 message
$ kubectl get providers.pkg.crossplane.io,functions.pkg.crossplane.io
NAME                                             INSTALLED   HEALTHY   PACKAGE                                                            AGE
provider.pkg.crossplane.io/provider-helm         True        True      xpkg.crossplane.io/crossplane-contrib/provider-helm:v1.4.0         45m
provider.pkg.crossplane.io/provider-kubernetes   True        True      xpkg.crossplane.io/crossplane-contrib/provider-kubernetes:v1.3.0   45m

NAME                                                      INSTALLED   HEALTHY   PACKAGE                                                                      AGE
function.pkg.crossplane.io/function-auto-ready            True        True      xpkg.crossplane.io/crossplane-contrib/function-auto-ready:v0.7.0             45m
function.pkg.crossplane.io/function-patch-and-transform   True        True      xpkg.crossplane.io/crossplane-contrib/function-patch-and-transform:v0.10.9   45m

Two more operational facts worth keeping in mind:

  • Composition selection. An XR picks its composition via compositionRef, via compositionSelector labels, or via the XRD's default. When the wrong recipe runs, look at selection first rather than inside the composition itself.
  • Changing the recipe changes live instances. Edit a composition and every XR pointing to it reconciles to the new definition without anyone touching the XRs. That's the platform team's superpower, and it's also your blast radius: one broken edit hits every tenant at once. Version your compositions and pin XRs with compositionUpdatePolicy: Manual whenever that matters.
Crossplane vs an operator, in one sentence

An operator encodes domain behavior in Go (failover, backups, upgrades); Crossplane encodes composition in YAML (this API expands into those resources). If the job is "keep Postgres alive", you want an operator. If the job is "give teams a one-field API that hands them a Postgres, a namespace, and a quota together", you want Crossplane wrapping that operator.

XRD and XR fields that decide behavior

scope, versions, composition selection, conditions

Most Crossplane troubleshooting tasks come down to a manifest with two or three fields off. These are the ones that matter:

XRD fieldDecidesTrap
spec.scopeNamespaced (v2 default), Cluster, or LegacyCluster (v1 semantics with claims)Immutable after creation, and a namespaced XR can't own cluster-scoped composed resources
spec.group / spec.namesThe API group, kind, and plural of the generated CRDThe CRD name is <plural>.<group>; that exact string is what kubectl explain and RBAC expect
spec.versions[].servedWhether the API server accepts that versionserved: false rejects every XR written at that version
spec.versions[].referenceableThe single version Compositions may targetExactly one version can be referenceable; switching it means updating every Composition's compositeTypeRef.apiVersion
spec.versions[].schema.openAPIV3SchemaThe developer-facing contractNever define status.conditions or anything under spec.crossplane / status.crossplane; those are reserved and silently ignored
spec.defaultCompositionRefThe Composition used when an XR doesn't pick oneConsulted only at XR creation; existing XRs keep their pinned compositionRef
spec.enforcedCompositionRefForces one Composition for every XR of this kindOverrides whatever the XR asked for; check here first when "the wrong recipe ran even though I set compositionRef"
spec.connectionSecretKeysWhich connection detail keys the XR is allowed to exposeAny key a Composition writes that isn't listed in the XRD gets dropped silently
spec.claimNamesClaim kind for LegacyCluster XRDs onlyInvalid on Namespaced or Cluster XRDs

An XRD reports Established once its CRD is installed and Offered once a claim CRD exists (legacy only). kubectl get xrd prints both columns. If Established is False, the API server almost certainly rejected your schema, and the condition message tells you why.

What the developer's XR controls

In v2, the Crossplane-specific knobs live under spec.crossplane (legacy cluster-scoped XRs and claims keep them at the top of spec):

spec:
  team: team-c                      # your schema
  crossplane:
    compositionRef: { name: appenvironment-small }   # or compositionSelector.matchLabels
    compositionUpdatePolicy: Manual                  # Automatic is the default
    compositionRevisionRef: { name: appenvironment-small-7c9a2 }
    writeConnectionSecretToRef: { name: team-c-conn }
  • Selection order. enforcedCompositionRef on the XRD always wins. After that, Crossplane checks the XR's compositionRef, then compositionSelector labels, and finally the XRD's defaultCompositionRef. Because Crossplane writes the resolved compositionRef back onto the XR, an instance created before you changed the default stays on the old recipe.
  • Revisions. Every edit to a Composition creates an immutable CompositionRevision (kubectl get compositionrevision -l crossplane.io/composition-name=<name>). Under compositionUpdatePolicy: Automatic, XRs track the newest revision; under Manual, they stay pinned to the compositionRevisionRef assigned at creation until you move them yourself. That's the blast-radius control promised in the previous section.
  • Pausing. Adding crossplane.io/paused: "true" to an XR or managed resource halts reconciliation without deleting anything. The lab's "paused XR" fault uses this exact annotation, and the XR's Synced condition reports ReconcilePaused.
  • Conditions. Synced tells you whether Crossplane managed to run the Composition and apply its output to the API server; Ready tells you whether the composed resources report ready. Synced=False points to a recipe or permission error (read the message: unknown function, bad patch path, forbidden). Ready=False with Synced=True points downstream to the provider or external API. Checking which of the two is false is always step one.

Inside a Pipeline composition

Each pipeline[] step names a functionRef and passes an input block. The main functions you'll see in the wild are function-patch-and-transform (declarative resources[] with base and patches), function-go-templating (Go templates rendering YAML, often referencing {{ .observed.composite.resource.spec.x }}), function-kcl and function-cue (typed config languages), function-environment-configs (loads EnvironmentConfig objects by Reference or Selector into the pipeline context, since native environment patching was removed from core in v1.18), and function-auto-ready, which belongs last so the XR flips Ready only when every composed resource is Ready.

For patch-and-transform, know the core patch types: FromCompositeFieldPath (XR to composed), ToCompositeFieldPath (composed to XR status), CombineFromComposite (join multiple XR fields with fmt), and the FromEnvironmentFieldPath pair. Transforms sit directly on a patch: map, match, math, string (fmt, convert, trimPrefix, regexp), and convert (string to int and back). Watch out for missing inputs: a patch whose fromFieldPath doesn't exist is silently skipped unless you set policy.fromFieldPath: Required, which turns a silent miss into a loud Synced=False message you can actually debug.

How this gets tested

"Developers must not be able to pick a different Composition" is enforcedCompositionRef. "Existing instances must not change when the platform team updates the recipe" is compositionUpdatePolicy: Manual. "Expose the generated namespace name to the developer" is a ToCompositeFieldPath patch into status, paired with that status field in the XRD schema. Every one of these is a one-field answer once you know where it lives.

Managed resources, packages, and the CLI

the layer under the composition

Managed resource fields

  • spec.forProvider declares the desired external state and enforces it continuously, reverting drift. spec.initProvider only applies values at creation time and leaves them alone afterward (ideal for autoscaled sizes).
  • spec.managementPolicies (beta, enabled by default) takes any subset of Observe, Create, Update, Delete, and LateInitialize, defaulting to ["*"]. Setting ["Observe"] gives you observe-only mode: pair it with the crossplane.io/external-name annotation to import an existing resource and populate status.atProvider without ever modifying or deleting the real thing. Dropping Delete orphans the external resource if the MR is deleted, and an empty list pauses the resource entirely.
  • spec.deletionPolicy (Delete by default, or Orphan) is the older single switch for orphaning. When both are set, a managementPolicies list without Delete wins.
  • spec.providerConfigRef points to the credentials object. In v2, namespaced MR kinds (API groups ending in .m.upbound.io or .m.crossplane.io) reference either a namespaced ProviderConfig or a ClusterProviderConfig; picking the wrong kind causes that auth-looking error we saw earlier. Because the ref defaults to default, a missing ProviderConfig/default is the classic first failure on a brand-new provider.
  • Conditions. Synced with reason ReconcileError carries the provider's error text, while Ready tracks the external resource itself. Run kubectl get managed to list every MR across every provider in one table with READY, SYNCED, and EXTERNAL-NAME columns.

Usage: deletion protection and ordering

A Usage (protection.crossplane.io/v1beta1) states that resource of is used by another (or simply protects it with a reason). As long as that Usage exists, Crossplane's admission webhook rejects deletes on the protected object with a 409 quoting your reason. Deleting the dependent user first lifts the lock, and setting replayDeletion: true automatically re-issues the blocked delete afterward. When an exam prompt says "the database must never be deleted while the app using it exists", that's a Usage, not RBAC.

Packages

Field / objectMeans
Provider / Configuration / Function (pkg.crossplane.io/v1)The three package kinds; each creates a revision object (ProviderRevision, ConfigurationRevision, FunctionRevision) where its real health lives
spec.packageOCI image reference; pin by tag or @sha256: digest
spec.packagePullPolicyIfNotPresent (default), Always, or Never
spec.revisionActivationPolicyAutomatic activates the newest revision immediately; Manual installs it inactive so you can cut over deliberately
spec.revisionHistoryLimitHow many old revisions to retain (default 1)
spec.skipDependencyResolution / ignoreCrossplaneConstraintsEscape hatches for a Configuration whose crossplane.yaml requires providers or a Crossplane version range your cluster doesn't satisfy
spec.runtimeConfigRefPoints to a DeploymentRuntimeConfig (replacing the deprecated ControllerConfig) to configure the provider pod's SA, resources, args, and metrics annotations
Lock (pkg.crossplane.io)The cluster singleton tracking resolved package dependencies; run kubectl get lock -o yaml to see what the package manager decided

kubectl get providers prints INSTALLED and HEALTHY. An unhealthy provider almost always boils down to one of three things: an image pull failure (private registry missing packagePullSecrets), an unsatisfied dependency (check the Lock and the revision's UnhealthyPackageRevision reason), or the provider pod crashing in crossplane-system (standard pod debugging). Providers built on crossplane-runtime expose crossplane_managed_resource_ready, crossplane_managed_resource_synced, crossplane_managed_resource_first_time_to_readiness_seconds, and crossplane_managed_resource_drift_seconds on port 8080, which is what a "monitor the platform API" task scrapes with a PodMonitor.

The CLI's three jobs

  • Render offline. crossplane composition render xr.yaml composition.yaml functions.yaml runs the pipeline locally in Docker and prints the composed resources with no cluster required (v1 docs call it crossplane beta render). It's the fastest way to check a patch path before applying or to see what someone else's Composition actually emits.
  • Trace live. crossplane resource trace (older docs: crossplane beta trace) draws the XR, its composed resources, and their Synced/Ready status as a tree; add -o wide for full error messages.
  • Build and push. crossplane xpkg build and crossplane xpkg push bundle an XRD, its Compositions, and a crossplane.yaml (with dependsOn) into a Configuration OCI package, turning a platform API into a versioned, installable artifact.

Your exam cluster might still ship a v1.x crossplane CLI where these subcommands live under beta; crossplane --help settles it in a second.

Trap

Crossplane's RBAC manager (crossplane-rbac-manager) generates aggregated ClusterRoles for every XRD and provider so crossplane-admin, crossplane-edit, and crossplane-view automatically pick up new kinds. When a provider gets stripped of RBAC (one of the lab's injected faults), the package still looks healthy, while every MR turns Synced=False with a forbidden message from the provider's ServiceAccount. Fix the missing ClusterRole or ClusterRoleBinding; don't reinstall the provider.

Exercises

tick the dot when its check passes

Run kubectl apply -f examples/crossplane/xr.yaml (or confirm team-c-dev is already there from install), then trace how it expands:

kubectl get appenvironment team-c-dev -o jsonpath='{.status.conditions}' | jq
kubectl get appenvironment team-c-dev -o jsonpath='{.status.namespace}{"\n"}'
kubectl -n default get objects.kubernetes.m.crossplane.io
kubectl get ns team-c && kubectl -n team-c get resourcequota tenant-quota -o jsonpath='{.spec.hard}'
outputcaptured 2026-08-26
$ kubectl get appenvironment team-c-dev -o jsonpath='{.status.conditions}' | jq
[
  {
    "lastTransitionTime": "2026-08-27T01:53:00Z",
    "observedGeneration": 4,
    "reason": "ReconcileSuccess",
    "status": "True",
    "type": "Synced"
  },
  {
    "lastTransitionTime": "2026-08-27T01:53:06Z",
    "observedGeneration": 4,
    "reason": "Available",
    "status": "True",
    "type": "Ready"
  },
  {
    "lastTransitionTime": "2026-08-27T01:53:00Z",
    "observedGeneration": 4,
    "reason": "WatchCircuitClosed",
    "status": "True",
    "type": "Responsive"
  }
]
$ kubectl get appenvironment team-c-dev -o jsonpath='{.status.namespace}{"\n"}'
team-c
$ kubectl -n default get objects.kubernetes.m.crossplane.io
NAME                      KIND            PROVIDERCONFIG   SYNCED   READY   AGE
team-c-dev-b4bcdb64391c   Namespace       default          True     True    43m
team-c-dev-e7e1d26b0016   ResourceQuota   default          True     True    43m
$ kubectl get ns team-c && kubectl -n team-c get resourcequota tenant-quota -o jsonpath='{.spec.hard}'
NAME     STATUS   AGE
team-c   Active   43m
{"requests.cpu":"4","requests.memory":"8Gi"}
verify: Ready is True, status.namespace reads team-c, two composed Objects exist, and the quota's hard values match the XR's spec (cpuQuota: "4") rather than the composition's placeholders. That last check proves the patches actually ran, which is the line between "installed" and "works".

Edit the composition to change the default requests.memory or stamp an extra label onto the namespace, apply it, and watch existing XRs reconcile to the new recipe without anyone touching them.

verify: kubectl get ns team-c --show-labels picks up your label within a minute. Compositions are the platform team's half of the contract, free to evolve without touching the API or its consumers.

Add podQuota (integer, default 10) to the XRD schema, patch it into the quota's spec.hard[pods] inside the composition, and set it in a new XR called team-f-dev. Order matters here: apply the XRD first, wait for Established, then update the composition, then apply the XR.

verify: kubectl -n team-f get resourcequota tenant-quota -o jsonpath='{.spec.hard.pods}' prints your number. You've just walked through a schema change, a recipe change, and a consumer change as three separate actors, which is the entire platform-API lifecycle.

Create an XR with team: Team-G (capital letter, so it's an invalid DNS label for a namespace). The XR won't go Ready. Trace the failure methodically instead of guessing: check XR conditions first, then inspect the composed Object's conditions (kubectl -n default get objects.kubernetes.m.crossplane.io -o yaml | grep -A3 message) to see the API server rejecting the namespace name. You can also run crossplane resource trace appenvironment <name> (the CLI is preinstalled) to draw the entire tree with statuses in one shot.

verify: you can point straight to the exact condition message and fix the XR. Failures propagate bottom-up through composed-resource conditions; that's your read path for every Crossplane incident.

An XRD that offers a claim has to clear two gates: the composite type must become Established, and the claim API must become Offered. Because this lab's XRD is a Crossplane v2 namespaced XR with no claim, it only needs Established and the OFFERED column stays blank. Reading those columns first saves you from chasing ghosts when a half-installed XRD causes a developer's manifest to fail as an unknown kind.

kubectl get xrd
kubectl get xrd appenvironments.platform.lab.local -o jsonpath='{.status.conditions}' | jq '.[] | {type, status, reason, message}'
kubectl api-resources --api-group=platform.lab.local
outputcaptured 2026-09-12
$ kubectl get xrd
NAME                                 ESTABLISHED   OFFERED   AGE
appenvironments.platform.lab.local   True                    99m
$ kubectl get xrd appenvironments.platform.lab.local -o jsonpath='{.status.conditions}' | jq '.[] | {type, status, reason, message}'
{
  "type": "Established",
  "status": "True",
  "reason": "WatchingCompositeResource",
  "message": null
}
$ kubectl api-resources --api-group=platform.lab.local
NAME              SHORTNAMES   APIVERSION                    NAMESPACED   KIND
appenvironments                platform.lab.local/v1alpha1   true         AppEnvironment
verify: Established is True (no Offered condition appears because this XRD offers no claim) and the kind shows up in api-resources. If Established is False, read its message before touching the Composition; the XRD sits upstream of everything else on this page.

Every edit to a Composition mints a new revision, and XRs follow the latest one by default. Switching to Manual freezes an XR in place, which is how you canary a platform API change on one tenant before rolling it out to everyone.

kubectl get compositionrevisions
kubectl patch composition appenvironment-kubernetes --type merge -p '{"metadata":{"labels":{"edited":"once"}}}'
kubectl get compositionrevisions -l crossplane.io/composition-name=appenvironment-kubernetes
kubectl apply -f - <<'EOF'
apiVersion: platform.lab.local/v1alpha1
kind: AppEnvironment
metadata: { name: team-f-dev, namespace: default }
spec:
  team: team-f
  cpuQuota: "2"
  memoryQuota: 4Gi
  crossplane:
    compositionUpdatePolicy: Manual
EOF
sleep 20
kubectl get appenvironment team-f-dev -o jsonpath='{.spec.crossplane.compositionRevisionRef}{"\n"}'
kubectl get appenvironment team-c-dev -o jsonpath='{.spec.crossplane.compositionRevisionRef}{"\n"}'
kubectl patch composition appenvironment-kubernetes --type merge -p '{"metadata":{"labels":{"edited":"twice"}}}'
sleep 20
kubectl get appenvironment team-f-dev -o jsonpath='{.spec.crossplane.compositionRevisionRef}{"\n"}'
kubectl get appenvironment team-c-dev -o jsonpath='{.spec.crossplane.compositionRevisionRef}{"\n"}'
# team-f is this exercise's, not the lab's
kubectl delete appenvironment team-f-dev --ignore-not-found
kubectl delete ns team-f --ignore-not-found --wait=false
outputcaptured 2026-09-12
$ kubectl get compositionrevisions
NAME                                REVISION   XR-KIND          XR-APIVERSION                 AGE
appenvironment-kubernetes-2cfe70e   3          AppEnvironment   platform.lab.local/v1alpha1   5h18m
appenvironment-kubernetes-670ddf1   1          AppEnvironment   platform.lab.local/v1alpha1   21h
appenvironment-kubernetes-69b60a2   2          AppEnvironment   platform.lab.local/v1alpha1   5h19m
$ kubectl patch composition appenvironment-kubernetes --type merge -p '{"metadata":{"labels":{"edited":"once"}}}'
composition.apiextensions.crossplane.io/appenvironment-kubernetes patched
$ kubectl get compositionrevisions -l crossplane.io/composition-name=appenvironment-kubernetes
NAME                                REVISION   XR-KIND          XR-APIVERSION                 AGE
appenvironment-kubernetes-2cfe70e   3          AppEnvironment   platform.lab.local/v1alpha1   5h18m
appenvironment-kubernetes-670ddf1   1          AppEnvironment   platform.lab.local/v1alpha1   21h
appenvironment-kubernetes-69b60a2   4          AppEnvironment   platform.lab.local/v1alpha1   5h19m
$ kubectl apply -f - <<'EOF'
apiVersion: platform.lab.local/v1alpha1
kind: AppEnvironment
metadata: { name: team-f-dev, namespace: default }
spec:
  team: team-f
  cpuQuota: "2"
  memoryQuota: 4Gi
  crossplane:
    compositionUpdatePolicy: Manual
EOF
appenvironment.platform.lab.local/team-f-dev unchanged
$ sleep 20
$ kubectl get appenvironment team-f-dev -o jsonpath='{.spec.crossplane.compositionRevisionRef}{"\n"}'
{"name":"appenvironment-kubernetes-69b60a2"}
$ kubectl get appenvironment team-c-dev -o jsonpath='{.spec.crossplane.compositionRevisionRef}{"\n"}'
{"name":"appenvironment-kubernetes-69b60a2"}
$ kubectl patch composition appenvironment-kubernetes --type merge -p '{"metadata":{"labels":{"edited":"twice"}}}'
composition.apiextensions.crossplane.io/appenvironment-kubernetes patched
$ sleep 20
$ kubectl get appenvironment team-f-dev -o jsonpath='{.spec.crossplane.compositionRevisionRef}{"\n"}'
{"name":"appenvironment-kubernetes-69b60a2"}
$ kubectl get appenvironment team-c-dev -o jsonpath='{.spec.crossplane.compositionRevisionRef}{"\n"}'
{"name":"appenvironment-kubernetes-2cfe70e"}
$ # team-f is this exercise's, not the lab's
$ kubectl delete appenvironment team-f-dev --ignore-not-found
appenvironment.platform.lab.local "team-f-dev" deleted from default namespace
$ kubectl delete ns team-f --ignore-not-found --wait=false
namespace "team-f" deleted
verify: the Manual XR stays pinned to its original revision while the Automatic one moves to the newest.

If a tenant can choose their Composition, they can pick a looser or cheaper one. Setting enforcedCompositionRef on the XRD silently overrides whatever they ask for on every reconcile.

kubectl patch xrd appenvironments.platform.lab.local --type merge -p '{"spec":{"enforcedCompositionRef":{"name":"appenvironment-kubernetes"}}}'
kubectl apply -f - <<'EOF'
apiVersion: platform.lab.local/v1alpha1
kind: AppEnvironment
metadata: { name: team-i-dev, namespace: default }
spec:
  team: team-i
  crossplane:
    compositionRef: { name: something-else }
EOF
sleep 20
kubectl get appenvironment team-i-dev -o jsonpath='{.spec.crossplane.compositionRef}{"\n"}'
kubectl patch xrd appenvironments.platform.lab.local --type json -p '[{"op":"remove","path":"/spec/enforcedCompositionRef"}]'
kubectl delete appenvironment team-i-dev
outputcaptured 2026-09-13
$ kubectl patch xrd appenvironments.platform.lab.local --type merge -p '{"spec":{"enforcedCompositionRef":{"name":"appenvironment-kubernetes"}}}'
compositeresourcedefinition.apiextensions.crossplane.io/appenvironments.platform.lab.local patched
$ kubectl apply -f - <<'EOF'
apiVersion: platform.lab.local/v1alpha1
kind: AppEnvironment
metadata: { name: team-i-dev, namespace: default }
spec:
  team: team-i
  crossplane:
    compositionRef: { name: something-else }
EOF
appenvironment.platform.lab.local/team-i-dev created
$ sleep 20
$ kubectl get appenvironment team-i-dev -o jsonpath='{.spec.crossplane.compositionRef}{"\n"}'
{"name":"appenvironment-kubernetes"}
$ kubectl patch xrd appenvironments.platform.lab.local --type json -p '[{"op":"remove","path":"/spec/enforcedCompositionRef"}]'
compositeresourcedefinition.apiextensions.crossplane.io/appenvironments.platform.lab.local patched
$ kubectl delete appenvironment team-i-dev
appenvironment.platform.lab.local "team-i-dev" deleted from default namespace
verify: Crossplane overwrote the tenant's chosen reference with the enforced Composition.

The pause annotation lets you freeze a controller on one object while you investigate. Even better, the Synced condition explicitly reports paused instead of pretending everything is up to date, which is what makes it safe to use in production.

# start from a known value: without this the patch below is a no-op and nothing can move
kubectl annotate appenvironment team-c-dev crossplane.io/paused- --overwrite 2>/dev/null || true
kubectl patch appenvironment team-c-dev --type merge -p '{"spec":{"cpuQuota":"4"}}'
sleep 60
kubectl -n team-c get resourcequota -o jsonpath='{.items[0].spec.hard}{"\n"}'
kubectl annotate appenvironment team-c-dev crossplane.io/paused=true --overwrite
kubectl patch appenvironment team-c-dev --type merge -p '{"spec":{"cpuQuota":"16"}}'
sleep 30
kubectl get appenvironment team-c-dev -o jsonpath='{.status.conditions}' | jq '.[] | {type, status, reason}'
kubectl -n team-c get resourcequota -o jsonpath='{.items[0].spec.hard}{"\n"}'
kubectl annotate appenvironment team-c-dev crossplane.io/paused-
sleep 30
kubectl -n team-c get resourcequota -o jsonpath='{.items[0].spec.hard}{"\n"}'
kubectl patch appenvironment team-c-dev --type merge -p '{"spec":{"cpuQuota":"4"}}'
outputcaptured 2026-09-12
$ # start from a known value: without this the patch below is a no-op and nothing can move
$ kubectl annotate appenvironment team-c-dev crossplane.io/paused- --overwrite 2>/dev/null || true
appenvironment.platform.lab.local/team-c-dev annotated
$ kubectl patch appenvironment team-c-dev --type merge -p '{"spec":{"cpuQuota":"4"}}'
appenvironment.platform.lab.local/team-c-dev patched (no change)
$ sleep 60
$ kubectl -n team-c get resourcequota -o jsonpath='{.items[0].spec.hard}{"\n"}'
{"requests.cpu":"4","requests.memory":"8Gi"}
$ kubectl annotate appenvironment team-c-dev crossplane.io/paused=true --overwrite
appenvironment.platform.lab.local/team-c-dev annotated
$ kubectl patch appenvironment team-c-dev --type merge -p '{"spec":{"cpuQuota":"16"}}'
appenvironment.platform.lab.local/team-c-dev patched
$ sleep 30
$ kubectl get appenvironment team-c-dev -o jsonpath='{.status.conditions}' | jq '.[] | {type, status, reason}'
{
  "type": "Synced",
  "status": "False",
  "reason": "ReconcilePaused"
}
{
  "type": "Ready",
  "status": "True",
  "reason": "Available"
}
{
  "type": "Responsive",
  "status": "True",
  "reason": "WatchCircuitClosed"
}
$ kubectl -n team-c get resourcequota -o jsonpath='{.items[0].spec.hard}{"\n"}'
{"requests.cpu":"4","requests.memory":"8Gi"}
$ kubectl annotate appenvironment team-c-dev crossplane.io/paused-
appenvironment.platform.lab.local/team-c-dev annotated
$ sleep 30
$ kubectl -n team-c get resourcequota -o jsonpath='{.items[0].spec.hard}{"\n"}'
{"requests.cpu":"16","requests.memory":"8Gi"}
$ kubectl patch appenvironment team-c-dev --type merge -p '{"spec":{"cpuQuota":"4"}}'
appenvironment.platform.lab.local/team-c-dev patched
verify: the quota doesn't budge while the annotation is set, the condition reason reads ReconcilePaused, and the new value lands as soon as you remove the annotation.

The render command runs your composition pipeline locally against the exact same manifests the cluster uses. It's the fastest feedback loop in Crossplane, and the right move whenever a task asks you to preview what an XR would create.

cat > /tmp/functions.yaml <<'EOF'
apiVersion: pkg.crossplane.io/v1
kind: Function
metadata:
  name: function-patch-and-transform
spec:
  package: xpkg.crossplane.io/crossplane-contrib/function-patch-and-transform:v0.10.9
---
apiVersion: pkg.crossplane.io/v1
kind: Function
metadata:
  name: function-auto-ready
spec:
  package: xpkg.crossplane.io/crossplane-contrib/function-auto-ready:v0.7.0
EOF
crossplane composition render examples/crossplane/xr.yaml examples/crossplane/composition.yaml /tmp/functions.yaml
kubectl get functions.pkg.crossplane.io
kubectl get function -o jsonpath='{range .items[*]}{.metadata.name} {.spec.package}{"\n"}{end}'
rm -f /tmp/functions.yaml
outputcaptured 2026-09-13
$ cat > /tmp/functions.yaml <<'EOF'
apiVersion: pkg.crossplane.io/v1
kind: Function
metadata:
  name: function-patch-and-transform
spec:
  package: xpkg.crossplane.io/crossplane-contrib/function-patch-and-transform:v0.10.9
---
apiVersion: pkg.crossplane.io/v1
kind: Function
metadata:
  name: function-auto-ready
spec:
  package: xpkg.crossplane.io/crossplane-contrib/function-auto-ready:v0.7.0
EOF
$ crossplane composition render examples/crossplane/xr.yaml examples/crossplane/composition.yaml /tmp/functions.yaml
---
apiVersion: platform.lab.local/v1alpha1
kind: AppEnvironment
metadata:
  name: team-c-dev
  namespace: default
spec:
  crossplane:
    resourceRefs:
    - apiVersion: kubernetes.m.crossplane.io/v1alpha1
      kind: Object
      name: team-c-dev-3108b38c5d8e
    - apiVersion: kubernetes.m.crossplane.io/v1alpha1
      kind: Object
      name: team-c-dev-e07b1179d2fb
status:
  conditions:
  - lastTransitionTime: "2024-01-01T00:00:00Z"
    reason: WatchCircuitClosed
    status: "True"
    type: Responsive
  - lastTransitionTime: "2024-01-01T00:00:00Z"
    reason: ReconcileSuccess
    status: "True"
    type: Synced
  - lastTransitionTime: "2024-01-01T00:00:00Z"
    message: 'Unready resources: namespace, quota'
    reason: Creating
    status: "False"
    type: Ready
---
apiVersion: kubernetes.m.crossplane.io/v1alpha1
kind: Object
metadata:
  annotations:
    crossplane.io/composition-resource-name: namespace
  generateName: team-c-dev-
  labels:
    crossplane.io/composite: team-c-dev
  name: team-c-dev-e07b1179d2fb
... 54 more lines
$ kubectl get functions.pkg.crossplane.io
NAME                           INSTALLED   HEALTHY   PACKAGE                                                                      AGE
function-auto-ready            True        True      xpkg.crossplane.io/crossplane-contrib/function-auto-ready:v0.7.0             17h
function-patch-and-transform   True        True      xpkg.crossplane.io/crossplane-contrib/function-patch-and-transform:v0.10.9   17h
$ kubectl get function -o jsonpath='{range .items[*]}{.metadata.name} {.spec.package}{"\n"}{end}'
function-auto-ready xpkg.crossplane.io/crossplane-contrib/function-auto-ready:v0.7.0
function-patch-and-transform xpkg.crossplane.io/crossplane-contrib/function-patch-and-transform:v0.10.9
$ rm -f /tmp/functions.yaml
verify: the rendered output shows both composed Objects with team-c patched into the namespace name and the quota's namespace, without touching the cluster. Note the CLI path: in the v2 CLI installed here, both top-level render and the beta subgroup are gone. It's crossplane composition render, and the third argument is a functions file built from the Function objects listed below it. Render runs those functions in Docker locally, which is why it needs no cluster at all.

Every provider is a controller running under its own ServiceAccount, and its permission errors land in the composed resource's Synced condition. This is the exact fault the lab's drill injects, so see it on purpose first.

kubectl get managed
kubectl describe providerrevisions | head -40
kubectl get clusterrolebinding -o name | grep -i provider-kubernetes
CRB=$(kubectl get clusterrolebinding -o name | grep -i provider-kubernetes | head -1)
kubectl get "$CRB" -o yaml > /tmp/provider-crb.yaml
kubectl delete "$CRB"
kubectl patch appenvironment team-c-dev --type merge -p '{"spec":{"cpuQuota":"6"}}'
sleep 45
kubectl -n default get objects.kubernetes.m.crossplane.io -o jsonpath='{range .items[*]}{.metadata.name} {.status.conditions[?(@.type=="Synced")].reason} {.status.conditions[?(@.type=="Synced")].message}{"\n"}{end}'
kubectl apply -f /tmp/provider-crb.yaml
sleep 45
kubectl -n default get objects.kubernetes.m.crossplane.io -o jsonpath='{range .items[*]}{.metadata.name} {.status.conditions[?(@.type=="Synced")].status}{"\n"}{end}'
kubectl patch appenvironment team-c-dev --type merge -p '{"spec":{"cpuQuota":"4"}}'
outputcaptured 2026-09-13
$ kubectl get managed
NAME                                                        KIND            PROVIDERCONFIG   SYNCED   READY   AGE
object.kubernetes.m.crossplane.io/team-c-dev-91fc2ee050c5   ResourceQuota   default          True     True    17h
object.kubernetes.m.crossplane.io/team-c-dev-f9c700a787d0   Namespace       default          True     True    17h
object.kubernetes.m.crossplane.io/team-f-dev-6d59b5cab364   Namespace       default          True     True    55m
object.kubernetes.m.crossplane.io/team-f-dev-933e06392888   ResourceQuota   default          True     True    55m
$ kubectl describe providerrevisions | head -40
Name:         provider-helm-fdbfef781539
Namespace:    
Labels:       pkg.crossplane.io/package=provider-helm
Annotations:  friendly-name.meta.crossplane.io: Provider Helm
              meta.crossplane.io/description:
                The Helm Crossplane provider enables resource management of Helm Releases
                on Kubernetes Clusters, typically provisioned by Crossplane.
              meta.crossplane.io/license: Apache-2.0
              meta.crossplane.io/maintainer: Crossplane Maintainers <info@crossplane.io>
              meta.crossplane.io/readme:
                `provider-helm` is a Crossplane Provider that enables deployment and
                management of [Helm](https://helm.sh) Releases on Kubernetes clusters
                typically provisioned by Crossplane.
                
                If you encounter an issue please reach out on
                [slack.crossplane.io](https://slack.crossplane.io) and create an issue in
                the
                [crossplane-contrib/provider-helm](https://github.com/crossplane-contrib/provider-helm)
                repo.
              meta.crossplane.io/source: github.com/crossplane-contrib/provider-helm
API Version:  pkg.crossplane.io/v1
Kind:         ProviderRevision
Metadata:
  Creation Timestamp:  2026-09-12T19:12:45Z
  Finalizers:
    revision.pkg.crossplane.io
  Generation:  1
  Owner References:
    API Version:           pkg.crossplane.io/v1
    Block Owner Deletion:  true
    Controller:            true
    Kind:                  Provider
    Name:                  provider-helm
    UID:                   56132175-2bae-4e3f-86ad-77855951c315
  Resource Version:        363228
  UID:                     16360176-329d-4c59-9baa-08e4193b6e85
Spec:
  Desired State:                  Active
  Ignore Crossplane Constraints:  false
  Image:                          xpkg.crossplane.io/crossplane-contrib/provider-helm:v1.4.0
$ kubectl get clusterrolebinding -o name | grep -i provider-kubernetes
clusterrolebinding.rbac.authorization.k8s.io/crossplane-provider-kubernetes-17261e579786
clusterrolebinding.rbac.authorization.k8s.io/crossplane:provider:provider-kubernetes-17261e579786:system
$ CRB=$(kubectl get clusterrolebinding -o name | grep -i provider-kubernetes | head -1)
$ kubectl get "$CRB" -o yaml > /tmp/provider-crb.yaml
$ kubectl delete "$CRB"
clusterrolebinding.rbac.authorization.k8s.io "crossplane-provider-kubernetes-17261e579786" deleted
$ kubectl patch appenvironment team-c-dev --type merge -p '{"spec":{"cpuQuota":"6"}}'
appenvironment.platform.lab.local/team-c-dev patched
$ sleep 45
$ kubectl -n default get objects.kubernetes.m.crossplane.io -o jsonpath='{range .items[*]}{.metadata.name} {.status.conditions[?(@.type=="Synced")].reason} {.status.conditions[?(@.type=="Synced")].message}{"\n"}{end}'
team-c-dev-91fc2ee050c5 ReconcileError observe failed: cannot get object: resourcequotas "tenant-quota" is forbidden: User "system:serviceaccount:crossplane-system:provider-kubernetes-17261e579786" cannot get resource "resourcequotas" in API group "" in the namespace "team-c"
team-c-dev-f9c700a787d0 ReconcileSuccess 
team-f-dev-6d59b5cab364 ReconcileSuccess 
team-f-dev-933e06392888 ReconcileSuccess 
$ kubectl apply -f /tmp/provider-crb.yaml
clusterrolebinding.rbac.authorization.k8s.io/crossplane-provider-kubernetes-17261e579786 created
$ sleep 45
$ kubectl -n default get objects.kubernetes.m.crossplane.io -o jsonpath='{range .items[*]}{.metadata.name} {.status.conditions[?(@.type=="Synced")].status}{"\n"}{end}'
team-c-dev-91fc2ee050c5 True
team-c-dev-f9c700a787d0 True
team-f-dev-6d59b5cab364 True
team-f-dev-933e06392888 True
$ kubectl patch appenvironment team-c-dev --type merge -p '{"spec":{"cpuQuota":"4"}}'
appenvironment.platform.lab.local/team-c-dev patched
verify: the composed Object reports Synced False with a forbidden message naming the provider's ServiceAccount, while the XR above it just looks unhappy. Whenever the composite is vague, drop down to the composed resource.

managementPolicies: ["Observe"] pulls an existing object into Crossplane's model without creating, updating, or deleting it. That's how you bring brownfield infrastructure under a platform API without putting it at risk.

kubectl create ns observed-only --dry-run=client -o yaml | kubectl apply -f -
kubectl label ns observed-only owner=not-crossplane --overwrite
kubectl apply -f - <<'EOF'
apiVersion: kubernetes.crossplane.io/v1alpha2
kind: Object
metadata:
  name: observe-ns
  annotations:
    crossplane.io/external-name: observed-only
spec:
  managementPolicies: ["Observe"]
  providerConfigRef: { name: default }
  forProvider:
    manifest:
      apiVersion: v1
      kind: Namespace
      metadata: { name: observed-only }
EOF
sleep 30
kubectl get object observe-ns -o jsonpath='{.status.atProvider.manifest.metadata.labels}{"\n"}'
kubectl get object observe-ns -o jsonpath='{.status.conditions}' | jq '.[] | {type, status, reason}'
kubectl get ns observed-only -o jsonpath='{.metadata.ownerReferences}{"\n"}'
kubectl delete object observe-ns
sleep 10
kubectl get ns observed-only
kubectl delete ns observed-only
outputcaptured 2026-09-12
$ kubectl create ns observed-only --dry-run=client -o yaml | kubectl apply -f -
namespace/observed-only created
$ kubectl label ns observed-only owner=not-crossplane --overwrite
namespace/observed-only labeled
$ kubectl apply -f - <<'EOF'
apiVersion: kubernetes.crossplane.io/v1alpha2
kind: Object
metadata:
  name: observe-ns
  annotations:
    crossplane.io/external-name: observed-only
spec:
  managementPolicies: ["Observe"]
  providerConfigRef: { name: default }
  forProvider:
    manifest:
      apiVersion: v1
      kind: Namespace
      metadata: { name: observed-only }
EOF
object.kubernetes.crossplane.io/observe-ns created
$ sleep 30
$ kubectl get object observe-ns -o jsonpath='{.status.atProvider.manifest.metadata.labels}{"\n"}'
{"kubernetes.io/metadata.name":"observed-only","owner":"not-crossplane"}
$ kubectl get object observe-ns -o jsonpath='{.status.conditions}' | jq '.[] | {type, status, reason}'
{
  "type": "Synced",
  "status": "True",
  "reason": "ReconcileSuccess"
}
{
  "type": "Ready",
  "status": "True",
  "reason": "Available"
}
$ kubectl get ns observed-only -o jsonpath='{.metadata.ownerReferences}{"\n"}'
$ kubectl delete object observe-ns
object.kubernetes.crossplane.io "observe-ns" deleted
$ sleep 10
$ kubectl get ns observed-only
NAME            STATUS   AGE
observed-only   Active   44s
$ kubectl delete ns observed-only
namespace "observed-only" deleted
verify: status.atProvider mirrors the live namespace including the label Crossplane didn't set, the namespace carries no ownerReference, and deleting the Object leaves the namespace untouched. That last property is the whole safety guarantee.

A platform API is a production system, and its controllers export metrics just like any other workload. Adding one PodMonitor turns "is Crossplane healthy?" from a gut feeling into a PromQL query.

kubectl -n crossplane-system get pods -l pkg.crossplane.io/provider -o wide
kubectl apply -f - <<'EOF'
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata: { name: crossplane-providers, namespace: crossplane-system, labels: { release: prometheus } }
spec:
  selector:
    matchExpressions:
      - { key: pkg.crossplane.io/provider, operator: Exists }
  podMetricsEndpoints:
    - port: metrics
EOF
sleep 60
kubectl -n monitoring port-forward svc/prometheus-kube-prometheus-prometheus 9090:9090 & PF1=$!
sleep 5
curl -sG localhost:9090/api/v1/query --data-urlencode 'query=up{job=~".*provider.*"}' | jq '.data.result[] | {metric: .metric.pod, value: .value[1]}'
curl -sG localhost:9090/api/v1/query --data-urlencode 'query=crossplane_managed_resource_ready' | jq '.data.result | length'
kill $PF1
kubectl -n crossplane-system delete podmonitor crossplane-providers --ignore-not-found
outputcaptured 2026-09-12
$ kubectl -n crossplane-system get pods -l pkg.crossplane.io/provider -o wide
NAME                                                READY   STATUS    RESTARTS   AGE   IP            NODE           NOMINATED NODE   READINESS GATES
provider-helm-fdbfef781539-755f57bf99-jvrrp         1/1     Running   0          21h   10.244.2.2    cnpe-worker2   <none>           <none>
provider-kubernetes-17261e579786-54cfdf7bf8-ffp75   1/1     Running   0          21h   10.244.2.37   cnpe-worker2   <none>           <none>
$ kubectl apply -f - <<'EOF'
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata: { name: crossplane-providers, namespace: crossplane-system, labels: { release: prometheus } }
spec:
  selector:
    matchExpressions:
      - { key: pkg.crossplane.io/provider, operator: Exists }
  podMetricsEndpoints:
    - port: metrics
EOF
podmonitor.monitoring.coreos.com/crossplane-providers unchanged
$ sleep 60
$ kubectl -n monitoring port-forward svc/prometheus-kube-prometheus-prometheus 9090:9090 & PF1=$!
$ sleep 5
Forwarding from 127.0.0.1:9090 -> 9090
Forwarding from [::1]:9090 -> 9090
$ curl -sG localhost:9090/api/v1/query --data-urlencode 'query=up{job=~".*provider.*"}' | jq '.data.result[] | {metric: .metric.pod, value: .value[1]}'
Handling connection for 9090
{
  "metric": "provider-kubernetes-17261e579786-54cfdf7bf8-ffp75",
  "value": "1"
}
{
  "metric": "provider-helm-fdbfef781539-755f57bf99-jvrrp",
  "value": "1"
}
$ curl -sG localhost:9090/api/v1/query --data-urlencode 'query=crossplane_managed_resource_ready' | jq '.data.result | length'
Handling connection for 9090
4
$ kill $PF1
$ kubectl -n crossplane-system delete podmonitor crossplane-providers --ignore-not-found
podmonitor.monitoring.coreos.com "crossplane-providers" deleted from crossplane-system namespace
verify: both provider pods show up as up targets and the readiness gauge returns active series. Keep in mind that a mismatched port name in the PodMonitor produces zero targets with no error anywhere, so always check the pod spec before blaming Prometheus.

Self-check

answer before opening
Name the three objects and who owns each.

XRD (platform team: the promised API and schema), Composition (platform team: the expansion recipe, safe to evolve without changing the API), and XR (developer: an instance). Crossplane generates the CRD for you, which is the main labor saving.

An XR is stuck not-Ready and the message is unhelpful. Diagnostic order?

Check packages first (make sure providers and functions are Installed and Healthy), run crossplane resource trace, then inspect the composed resources' own conditions and the underlying API error inside them. Always work bottom-up, because that's the direction failures propagate.

Why can a namespaced XR not compose a cluster-scoped resource directly?

Kubernetes ownership rules forbid a namespaced object from owning a cluster-scoped one, and Crossplane uses ownerReferences to manage lifecycles. The workaround used in this lab is a namespaced Object (kubernetes.m.crossplane.io) that wraps the cluster-scoped manifest, authenticated with a ClusterProviderConfig.

You edit a Composition. What happens to the twelve XRs already using it?

All twelve reconcile to the new recipe automatically, without anyone touching them. That's hugely powerful, and it's also a wide blast radius. When you need controlled rollouts, set compositionUpdatePolicy: Manual to pin instances to a revision, or version the Composition and migrate tenants deliberately.

When would you choose kro or a plain operator over Crossplane?

Pick kro when you want the same declarative in-cluster expansion with far less machinery and can accept a younger API (3.6). Pick a plain operator when the value is ongoing domain behavior (failover, backups, upgrade orchestration) rather than wiring existing resources together. Crossplane shines when you're composing many resources, especially across external cloud APIs, behind one clean abstraction.

An XR shows Synced=True, Ready=False. Another shows Synced=False. What is each telling you?

Synced=False means Crossplane couldn't render or apply the composition (unknown function, bad patch path, forbidden, invalid manifest); the XR's message names the error, and the composed resources may not even exist yet. Synced=True, Ready=False means the recipe applied cleanly, but a composed resource isn't ready yet, so descend into its conditions (crossplane resource trace prints the whole tree). The first is usually a platform-team bug; the second is usually the provider or external system.

You must import an existing cloud database into Crossplane without risking any change to it. Fields?

Create a managed resource with spec.managementPolicies: ["Observe"] and set the crossplane.io/external-name annotation to the real database's identifier. Crossplane populates status.atProvider and never creates, updates, or deletes anything. Later, you can widen the policy (adding Update and Delete) to take over management gradually.

Which one field on the XRD makes every instance use one specific Composition regardless of what the XR asks for, and what happens to compositionRef on the XR?

spec.enforcedCompositionRef.name. It overrides compositionRef, compositionSelector, and defaultCompositionRef, and Crossplane overwrites the XR's compositionRef with the enforced Composition. By contrast, defaultCompositionRef only fills in a blank at creation time and never overrides an explicit choice.

A provider shows HEALTHY: False. Name the three usual causes and where each is visible.

Image pull failure (a private registry missing packagePullSecrets): check the revision's conditions and provider pod events. Unsatisfied dependency or Crossplane version constraint: check the ProviderRevision condition reason UnhealthyPackageRevision and the Lock object. Crashing provider pod: standard pod debugging in crossplane-system. Remember that if the package is healthy while MRs show Synced=False with forbidden, you're looking at RBAC, not a broken package.

Docs to know your way around

study time, not exam time
  • docs.crossplane.io: Composite Resource Definitions, Compositions (the function pipeline page), and provider-kubernetes's Object docs on the Upbound marketplace.
  • Offline: crossplane resource trace --help (the single most useful diagnostic in the ecosystem), plus kubectl explain composition.spec and kubectl explain xrd.spec.
  • docs.crossplane.io/latest/composition/composite-resource-definitions (scope, versions, default and enforced composition refs) and /composition/composition-revisions (Automatic vs Manual): the two pages behind most "make the XR do X" tasks.
  • docs.crossplane.io/latest/managed-resources/managed-resources: the managementPolicies table, plus /guides/import-existing-resources for observe-only imports.
  • Offline: kubectl get xrd (ESTABLISHED column), kubectl get managed, kubectl get compositionrevisions, and crossplane --help to see whether render and trace live under beta on the exam cluster's version.