Engineering Playbook
IaC

Crossplane

Building a Control Plane with Kubernetes.

Crossplane

Crossplane is a Kubernetes Add-on. It runs inside your cluster and constantly reconciles your infrastructure. It turns Kubernetes into a Universal Control Plane.

How it works

  1. Install Crossplane into a K8s cluster.
  2. Install Providers (AWS, GCP, Azure) into Crossplane.
  3. Create Resources by writing Kubernetes YAML.

Instead of kubectl apply -f pod.yaml, you run kubectl apply -f database.yaml, and Crossplane spins up an RDS Instance on AWS.


Compositions (XRDs)

The killer feature of Crossplane is the ability to create your own APIs.

You don't want developers asking for an "AWS RDS db.t3.medium". You want them asking for a PostgresDB.

  1. Composite Resource Definition (XRD): Defines the API (e.g., kind: PostgresDB).
  2. Composition: Defines the implementation (e.g., "On AWS, map PostgresDB to an RDS Instance + Security Group + Subnet Group").

The Developer Experience: The developer writes this simple YAML:

apiVersion: my-company.io/v1alpha1
kind: PostgresDB
metadata:
  name: my-db
spec:
  storage: 20GB

Crossplane watches this and automatically provisions the underlying AWS resources.


GitOps + Crossplane

Since Crossplane resources are just Kubernetes YAML, you can manage your cloud infrastructure using ArgoCD.

  1. Commit s3-bucket.yaml to Git.
  2. ArgoCD syncs it to the K8s Cluster.
  3. Crossplane sees the new resource and calls the AWS API to create the bucket.
  4. Drift Detection: If someone deletes the bucket in the AWS Console, Crossplane (running in the loop) sees it's missing and recreates it automatically.

Complexity Warning

Crossplane is powerful but heavy. You are effectively building your own internal Heroku. Only use it if you have a Platform Team dedicated to maintaining the Control Plane.