This document is for a preview version of Crossplane.

This document applies to Crossplane v2.0-preview and not to the latest release v1.19.

Don't use Crossplane v2.0-preview in production.

Crossplane is a control plane framework for platform engineering.

Crossplane lets you build control planes to manage your cloud native software. It lets you design the APIs and abstractions that your users use to interact with your control planes.

Tip

A control plane is software that controls other software.

Control planes are a core cloud native pattern. The major cloud providers are all built using control planes.

Control planes expose an API. You use the API to tell the control plane what software it should configure and how - this is your desired state.

A control plane can configure any cloud native software. It could deploy an app, create a load balancer, or create a GitHub repository.

The control plane configures your software, then monitors it throughout its lifecycle. If your software ever drifts from your desired state, the control plane automatically corrects the drift.

Crossplane has a rich ecosystem of extensions that make building a control plane faster and easier. It’s built on Kubernetes, so it works with all the Kubernetes tools you already use.

Crossplane’s key value is that it unlocks the benefits of building your own Kubernetes custom resources without having to write controllers for them.

Not familiar with Kubernetes custom resources and controllers? This DevOps Toolkit video has a great explanation.

Note
Kubebuilder is a popular project for building Kubernetes controllers. Look at the Kubebuilder documentation to see what’s involved in writing a controller.

Crossplane components

Crossplane has three major components:

You can use all three components to build your control plane, or pick only the ones you need.

Composition

Composition lets you build custom APIs to control your cloud native software.

Crossplane extends Kubernetes. You build your custom APIs by using Crossplane to extend Kubernetes with new custom resources.

To extend Kubernetes without using Crossplane you need a Kubernetes controller. The controller is the software that reacts when a user calls the custom resource API.

Say you want your control plane to serve an App custom resource API. When someone creates an App, the control plane should create a Kubernetes Deployment and a Service.

If there’s not already a controller that does what you want - and exposes the API you want - you have to write the controller yourself.

flowchart TD
user(User)

subgraph control [Control Plane]
  api(App API)
  controller[Your App Controller]
  deployment(Deployment API)
  service(Service API)
end

user -- create --> api
controller watch@<-- watch --> api
controller -- create --> deployment
controller -- create --> service

watch@{animate: true}

With Crossplane you don’t have to write a controller. Instead you configure a pipeline of functions. The functions return declarative configuration that Crossplane should apply.

flowchart TD
user(User)

subgraph control [Control Plane]
  api(App API)

  subgraph crossplane [Composition Engine]
    fn(Python Function)
  end

  deployment(Deployment API)
  service(Service API)
end

user -- create --> api
crossplane watch@<-- watch --> api
crossplane -- create --> deployment
crossplane -- create --> service

watch@{animate: true}

With Composition you avoid writing and maintaining complex controller code that’s hard to get right. Instead you focus on expressing your business logic, and work in your preferred language.

Important

Composition functions are like configuration language plugins.

Functions allow you to write your configuration in several languages, including YAML, KCL, Python, and Go.

You can use composition together with managed resources to build new custom resource APIs powered by managed resources.

Follow Get Started with Composition to see how composition works.

Managed resources

Managed resources (MRs) are ready-made Kubernetes custom resources.

Each MR extends Kubernetes with the ability to manage a new system. For example there’s an RDS instance MR that extends Kubernetes with the ability to manage AWS RDS instances.

Crossplane has an extensive library of managed resources you can use to manage almost any cloud provider, or cloud native software.

With Crossplane you don’t have to write a controller if you want to manage something outside of your Kubernetes cluster using a custom resource. There’s already a Crossplane managed resource for that.

flowchart TD
user(User)

subgraph control [Control Plane]
  instance(RDS Instance API)
  controller(Managed Resource Controller)
end

subgraph aws [Amazon Web Services]
  rds(RDS Instance)
end

user -- create --> instance
controller watch-rds@<-- watch --> instance
controller -- create --> rds

watch-rds@{animate: true}

You can use managed resources together with composition to build new custom resource APIs powered by MRs.

flowchart TD
user(User)

subgraph control [Control Plane]
  api(App API)

  subgraph crossplane [Composition Engine]
    fn(Python Function)
  end

  deployment(Deployment API)
  service(Service API)
  instance(RDS Instance API)

  controller(Managed Resource Controller)
end

subgraph aws [Amazon Web Services]
  rds(RDS Instance)
end

user -- create --> api
crossplane watch-apps@<-- watch --> api
crossplane -- create --> deployment
crossplane -- create --> service
crossplane -- create --> instance

controller watch-rds@<-- watch --> instance
controller -- create --> rds

watch-apps@{animate: true}
watch-rds@{animate: true}

Follow Get Started with Managed Resources to see how managed resources work.

Note

Only AWS managed resources support the Crossplane v2 preview.

Maintainers will update the managed resources for other systems including Azure, GCP, Terraform, Helm, GitHub, etc to support Crossplane v2 soon.

Package manager

The Crossplane package manager lets you install new managed resources and composition functions.

You can also package any part of a control plane’s configuration and install it using the package manager. This allows you to deploy several control planes with identical capabilities - for example one control plane per region or per service.

Read about Crossplane packages to learn about the package manager.