crossplane: The Crossplane command-line tool (crossplane/cli v2.5.0): trace, render, packages, XRDs
crossplane <command> [flags]
What it does
A client-side tool: it reads your kubeconfig like kubectl and never runs inside the cluster. On call two commands matter: crossplane resource trace (an XR or claim and everything under it as a tree, with SYNCED, READY and the status message of each object) and crossplane composition render (run a Composition locally, the functions and the Crossplane render engine in Docker, and print what it would create). Since the CLI moved to its own repository (v2.3), crossplane beta trace is crossplane resource trace and crossplane render is crossplane composition render (the old top-level render is kept hidden).
Options you will use
--verbose- Print verbose logging statements.
-h, --help- Show context-sensitive help.
Examples
$ crossplane resource trace database orders -n team-a -o widethe XR, what it composed, full messages
$ crossplane composition render xr.yaml composition.yaml functions.yamlwhat this Composition would create
$ crossplane composition render xr.yaml comp.yaml fns.yaml -o observed/ -rwith existing resources, and the functions' warnings
$ crossplane versionclient and server versions
Gotchas
resource tracetakes the kind first, kubectl-style:crossplane resource trace database orders -n team-aordatabase/orders.- The STATUS column shows the Synced message while Synced is not True, else the Ready one, cut to its last 64 characters: -o wide prints it whole.
composition renderneeds Docker: each function runs as a container, and v2.5 runs Crossplane's own render engine in a container too (--crossplane-binary uses a local binary instead).
Taught in
- 42.2 Crossplane v2: the Kubernetes API as a control plane
- 42.4 Providers, functions and their credentials
- 42.6 Managed resources: Synced, Ready, external names and policies
- 42.9 Compositions and function-patch-and-transform
- 42.12 Debugging composite resources on call
- 42.14 Changing a platform without destroying data
On the blog
Try crossplane in a real terminal Free, in your browser - a real Ubuntu terminal to try it in, with missions that check your work.