CROSSPLANE

Santosh Khelge
5 min readSep 14, 2021

--

What is Crossplane?

It is an open-source multi-cloud plane, that's it!!

It is a tool in the multi-cloud management category of a tech stack

Crossplane introduces workload and resources abstraction on top of existing manages services that enable a high degree of workload portability.

A single crossplane enables the provision and full life-cycle management of services and infrastructure across a wide range of provides, offerings, vendors, regions, and clusters.

Who uses Crossplane?

Kubernetes, Amazon EC2, Microsoft Azure, Amazon RDS, and Google Compute Engine are some of the popular tools that integrate with Crossplane. Here’s a list of all 11 tools that integrate with Crossplane.

Crossplane enables you to provision, compose, and consume infrastructure in any cloud service provider using the Kubernetes API. Using Crossplane you can create resources on the cloud using simple manifests and can then integrate this with your CI/CD or GitOps pipelines. Crossplane is an open-source project. It is started by Upbound and then later got adopted by the CNCF as a sandbox project.

Image Credits: Crossplane

Build Your Own PaaS with Crossplane: Kubernetes, OAM, and Core Workflows.

Crossplane: Controlling infrastructure via Kubernetes

Crossplane is implemented as a Kubernetes add-on and extends any cluster with the ability to provision and manage cloud infrastructure, services, and applications. Crossplane uses Kubernetes-styled declarative and API-driven configuration and management to control any piece of infrastructure, on-premises or in the cloud. Through this approach, infrastructure can be configured using custom resource definitions (CRDs) and YAML. It can also be managed via well established tools like kubectl or via the Kubernetes API itself. The use of Kubernetes also allows the definition of security controls, via RBAC, or policies, using Open Policy Agent (OPA) implemented via Gatekeeper.

As part of the Crossplane installation a Kubernetes resource controller is configured to be responsible for the entire lifecycle of a resource: provisioning, health checking, scaling, failover, and actively responding to external changes that deviate from the desired configuration. Crossplane integrates with continuous delivery (CD) pipelines so that application infrastructure configuration is stored in a single control cluster. Teams can create, track, and approve changes using cloud native CD best practices such as GitOps. Crossplane enables application and infrastructure configuration to co-exist on the same Kubernetes cluster, reducing the complexity of toolchains and deployment pipelines.

The clear abstractions, use of personas, and the “above and below the line” approach draws heavily on the work undertaken within the Open Application Model.

OAM: Team-centric standard for building cloud native apps

Initially created by Microsoft, Alibaba, and Upbound, the Open Application Model (OAM) specification describes a model where developers are responsible for defining application components, application operators are responsible for creating instances of those components and assigning them application configurations, and infrastructure operators are responsible for declaring, installing, and maintaining the underlying services that are available on the platform. Crossplane is the Kubernetes implementation of the specification.

With OAM, platform builders can provide reusable modules in the format of Components, Traits, and Scopes. This allows platforms to do things like package them in predefined application profiles. Users choose how to run their applications by selecting profiles, for example, microservice applications with high service level objective (SLO) requirements, stateful apps with persistent volumes, or event-driven functions with horizontally autoscaling.

The OAM specification introduction document presents a story that explores a typical application delivery lifecycle.

  1. The developer creates a web application;
  2. The application operator deploys instances of that application, and configures it with operational traits, such as autoscaling;
  3. The infrastructure operator decides which underlying technology is used to handle the deployment and operations.

To deliver an application, each individual component of a program is described as a Component YAML by an application developer. This file encapsulates a workload and the information needed to run it.

To run and operate an application, the application operator sets parameter values for the developers’ components and applies operational characteristics, such as replica size, autoscaling policy, ingress points, and traffic routing rules in an ApplicationConfiguration YAML. In OAM, these operational characteristics are called Traits. Writing and deploying an ApplicationConfiguration is equivalent to deploying an application. The underlying platform will create live instances of defined workloads and attach operational traits to workloads according to the ApplicationConfiguration spec.

Infrastructure operators are responsible for declaring, installing, and maintaining the underlying services that are available on the platform. For example, an infrastructure operator might choose a specific load balancer when exposing a service, or a custom database configuration that ensures data is encrypted and replicated globally.

Exploring a typical Crossplane workflow

To make the discussion more concrete, let’s explore a typical Crossplane workflow, from the installation of the project to usage.

First, install Crossplane and create a Kubernetes cluster. Next, install a provider and configure your credentials. Infrastructure primitives can be provisioned from any provider e.g. (GCP, AWS, Azure, Alibaba, and (custom-created) on-premise.

A platform operator defines, composes, and publishes your own infrastructure resources with declarative YAML, resulting in your own infrastructure CRDs being added to the Kubernetes API for applications to use.

An application developer publishes application components to communicate any fundamental, suggested or optional properties of our services and their infrastructure requirements.

An application operator ties together the infrastructure components and application components, specificies configuration, and runs the application.

Conclusion

Kubernetes is being used as the foundation for many “cloud-native” platforms, and therefore investing in both models of how the team interacts with this platform and also how the underlying components are assembled is vitally important and a potential competitive advantage for organizations. As stated by Dr. Nicole Forsgren et al in Accelerate, minimizing lead time (from idea to value) and increasing deployment frequency are correlated with high-performing organizations. The platform plays a critical role here.

Crossplane is a constantly evolving project, and as the community expands more and more feedback is being sought. Engineering teams can visit the Crossplane website to get started with the open-source projects, and feedback can be shared in the Crossplane Slack.

--

--