top of page

Crossplane and Kratix: A Powerful Duo for Platform Engineering Success

Crossplane is a critical component in building internal developer platforms, transforming your Kubernetes cluster into a universal control plane that allows you to declaratively manage the lifecycle of your cloud infrastructure through standard Kubernetes APIs. It leverages the Kubernetes reconcile loop to elegantly handle configuration drift and offers a familiar interface to engineers accustomed to Kubernetes YAML.


Infrastructure as Code: one piece of the platform puzzle

Infrastructure as Code is only one piece of the broader platform puzzle. While platform engineers might find producing Composite Resource Definitions (XRDs) straightforward, the complexity of templating in Kubernetes (using YAML, Helm, Kustomize, etc.) may not be as simple for the application developers who are the ultimate end-users of the Platform. Moreover, when platform teams require something more bespoke for their organisation, they can quickly find themselves thrown into the deep end of provider creation, which involves the inherent complexity of a Kubernetes Controller combined with unique requirements.


The "glue code" for integrating with other critical aspects like CI/CD, configuration, and business processes is a common pain point in IaC technologies, including Crossplane. For instance, you might have a complex Terraform estate that isn't easily automated, or a bespoke internal tool that isn't worth transforming into a new provider. 


You may also want to provide different user interfaces to your users, like a Portal or a CLI, which adds additional management overhead. This situation often turns IaC into either a bottleneck for application developers waiting for experts or an upfront and ongoing cost if developers are forced to use it, ultimately slowing the delivery of business value. The cost to maintain processes behind multiple, disparate tools can be crippling.


Kratix: providing platform orchestration to Crossplane

Kratix is often described as a platform orchestrator, and it is specifically built to help platform teams deliver more value faster, safer, and with less overhead.


Kratix complements Crossplane by acting as the "intelligent glue" that joins your interface of choice (UI, API, CLI) with your infrastructure as code layer, performing the platform orchestration while providing users with a clean and simple API.


Through Promises, Kratix enables platform teams to deliver "everything-as-a-service", simplifying complex workflows, incorporating unique organisational requirements such as security and compliance, and abstracting away the underlying infrastructure tools from application developers. 


In this blog, we will explore how Kratix and Crossplane, when used together, can help platform teams deliver a cohesive, self-service Platform-as-a-Product (PaaP) that truly enhances the developer experience.


Paving a golden path with Kratix and Crossplane

Let's imagine your application teams require a PostgreSQL database for their applications. For production-type environments, they need an enterprise-grade version of PostgresSQL. For development-type environments, their requirements are less strict, and they would benefit from having faster services. Your organisation also wants to keep costs low wherever possible.


You decide to create a Database Promise where, when the target environment is "development", the requester will get an in-cluster PostgreSQL provisioned, backed by an Operator. For "production" environments, they will get an AWS RDS instance, created and managed by Crossplane via the AWS Provider.


With Kratix, you can author a single Promise that delivers on the application team's needs for both types of environments. The demo below will cover this scenario.


Demo: on-demand databases with Kratix and Crossplane

We will start by creating three Kubernetes Clusters with KinD:

  • A Platform Cluster, where Kratix and the Database promise will be installed.

  • A Dev Cluster, to run Dev-types of workloads.

  • A Prod Cluster, to run Production-types of workloads. This cluster has Crossplane and the AWS provider already deployed.


--------------------------------------------------------------------------------------------------

You can use a Promise to install Crossplane in your clusters!

Take a look at the Crossplane Promise in the Kratix Promise Marketplace.

--------------------------------------------------------------------------------------------------


Overview of the Environment

With the clusters ready and registered with the Platform, we can go ahead and install the Database Promise in the Platform cluster. In the Promise definition, we determined what should be installed in which cluster at Promise installation time. For this Promise, it means:


  • Installing a PostgreSQL Operator in the Dev Destination.

  • Installing Composite Resource Definitions and Compositions for an RDS PostgreSQL database in the Prod Destination.


Installing the Promise and verifying the dependencies

Once the Promise is installed, developers using the platform can now request databases and get exactly what they need, on demand and self-served.


To request a new database, the user must provide the type (prod or dev). This API is defined within the Promise and can be extended to take all sorts of arguments—like the DB size, region, or version—if the platform team later learn their customers need different configuration options exposed.


As an application developer using the Platform, let's send a request for a new development database. When the request comes in, Kratix executes the Resource Workflow. The workflow determines what should be instantiated based on the type of environment. For dev, it's the Operator-based PostgreSQL manifest. These workloads are placed onto the dev Destination, which can run those types of workloads. Once the provisioning completes, the developer can start using the database.


Requesting a Dev database

For production environments, the Workflow produces the documents to create an RDS instance, which utilises Crossplane's AWS provider. Because Crossplane handles the complexity of managing the lifecycle of the cloud resources, all that the Kratix Workflow needs to output is the Crossplane Claim for the RDS Composite Resource Definition defined by the Promise.


The workloads get assigned to the production destination, and then Crossplane reconciles these requests and creates the RDS in the cloud. If the time comes when the platform team decides to introduce another cloud service, all they need to do is add an additional resource and let Crossplane do all the heavy lifting.


Kratix integrates very well with Backstage. For the Production request, let's use the auto-generated Backstage template to create the database request.



The Database Promise also includes a notification step: it will send a message to a Slack channel notifying about the creation of the Service. This is to illustrate that Kratix can incorporate any business requirements you may have, such as billing, security, compliance, notifications, etc.


Notifications sent via the Kratix Promise to Slack
Notifications sent via the Kratix Promise to Slack

You paved a golden path for your users, enabling teams to access the database they need to run their applications in both development and production environments seamlessly. You can continue to iterate from this point by collaborating and learning with the application teams to add/refine promises to reduce their heavy lifting and make their lives easier.


With Kratix multi-destination capabilities, you can also expand your platform to multiple clouds with little effort. You may want a Destination running on Azure with Azure-specific Crossplane providers, completely isolated from the AWS one. By leveraging Kratix features, you can easily add such capability to the Database Promise.


Finally, by using Compound Promises (Promises of Promises of Promises, etc), you can build even more compelling Golden Paths. You can create a Cache Promise, a Message Promise, and a Runtime Promise, all following a similar pattern to the Database above. You can then combine those into a higher-level Promise that makes it very easy for application developers to get all the services they need in a single request.


Extending Crossplane with Kratix: Orchestration, Interfaces, and Business Logic

In this blog, we have explored how the combined power of Kratix and Crossplane fundamentally changes how organisations can build and evolve their internal developer platforms.


Crossplane serves as an incredibly powerful infrastructure control plane, and its strength lies in allowing platform teams to define custom APIs and abstractions, encapsulating policies and guardrails to enable self-service for infrastructure provisioning.


However, as we’ve seen and demonstrated, infrastructure as code (IaC) is only one piece of the platform puzzle. A truly comprehensive platform must also integrate additional tools, manage diverse interfaces (such as UIs, CLIs, and GitOps), and embed critical business processes like billing checks, security scans, and audits. This is where Kratix acts as the intelligent glue, orchestrating these various components and elevating the platform experience.


Ultimately, leveraging Crossplane for its robust infrastructure management and Kratix for its platform orchestration capabilities means that platform teams can raise the "value line" for their users. Instead of providing mere access to low-level services, they deliver entire developer experiences as-a-service, empowering their teams to ship software quicker, more safely, and with greater efficiency.


Want to learn more about how to leverage Kratix to build your Platform? Book a demo or reach out on Slack!



Cover Photo by Shawn on Unsplash

Comments


bottom of page