Crossplane extends Kubernetes so you can manage cloud infrastructure using the same tools you use for workloads. Instead of writing Terraform, you write Kubernetes manifests. Instead of running terraform apply, you kubectl apply.
How It Works
Crossplane installs as a set of controllers in your Kubernetes cluster. You install providers for your cloud (AWS, GCP, Azure), then create custom resources that represent cloud infrastructure:
apiVersion: database.aws.crossplane.io/v1beta1
kind: RDSInstance
metadata:
name: my-database
spec:
forProvider:
region: eu-west-1
dbInstanceClass: db.t3.medium
engine: postgres
engineVersion: "15"
masterUsername: admin
writeConnectionSecretToRef:
name: db-credentials
namespace: defaultApply this manifest and Crossplane provisions an RDS instance. Delete it and Crossplane destroys the instance. The Kubernetes reconciliation loop handles drift detection automatically.
Master this topic with hands-on labs
Go beyond reading — build real projects in sandboxed environments with expert video guidance.
Browse Courses →Crossplane vs Terraform
| Aspect | Crossplane | Terraform |
|---|---|---|
| Interface | Kubernetes API (kubectl) | CLI (terraform) |
| State | Kubernetes etcd | State file (S3, etc.) |
| Drift detection | Continuous (reconciliation loop) | On terraform plan only |
| Language | YAML (Kubernetes manifests) | HCL |
| GitOps native | Yes (ArgoCD/Flux) | Requires wrapper (Atlantis) |
| Learning curve | Kubernetes knowledge required | Standalone tool |
Compositions: The Platform Layer
Crossplane's power comes from Compositions. Platform teams define high-level abstractions that map to underlying resources:
apiVersion: apiextensions.crossplane.io/v1
kind: CompositeResourceDefinition
metadata:
name: xdatabases.platform.example.com
spec:
group: platform.example.com
names:
kind: XDatabase
plural: xdatabases
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
properties:
spec:
properties:
size:
type: string
enum: ["small", "medium", "large"]
engine:
type: string
enum: ["postgres", "mysql"]Developers request a database by size and engine. The platform team's Composition handles instance class, backup policy, security groups, and monitoring — all hidden from the developer:
# What developers see
apiVersion: platform.example.com/v1alpha1
kind: XDatabase
metadata:
name: orders-db
spec:
size: medium
engine: postgresThis is platform engineering in practice: simple interfaces backed by opinionated infrastructure.
Get weekly IT automation tips
Docker, Ansible, Terraform, MLOps — curated insights delivered to your inbox. No spam.
Subscribe Free →When to Choose Crossplane
Good fit: - Your platform is Kubernetes-native - You want continuous drift detection, not periodic - You use GitOps (ArgoCD or Flux) for everything - Your platform team wants to define custom abstractions - You need self-service infrastructure provisioning via Kubernetes API
Not ideal: - Your team does not run Kubernetes - You need one-off infrastructure scripts - Terraform expertise is already deep in your organization - Simple infrastructure needs (a few resources, rarely changed)
Getting Started
# Install Crossplane
helm install crossplane crossplane-stable/crossplane \
--namespace crossplane-system --create-namespace
# Install AWS provider
kubectl apply -f - <<EOF
apiVersion: pkg.crossplane.io/v1
kind: Provider
metadata:
name: provider-aws
spec:
package: xpkg.upbound.io/upbound/provider-aws-ec2:v1
EOFStart with a single resource type (like S3 buckets or RDS instances). Validate the workflow. Then build Compositions for your platform's self-service layer.
---
Ready to go deeper? Learn Kubernetes and infrastructure as code with hands-on courses at CopyPasteLearn.
Ready to learn by doing?
Stop reading tutorials — start building. Expert video courses with hands-on labs in real sandboxed environments.
Related Articles
Kubernetes Cost Optimization Guide
Kubernetes clusters are often 60-70% over-provisioned. Learn practical cost optimization strategies: right-sizing, spot instances, autoscaling, namespace.
Pulumi Infrastructure as Code Guide
Pulumi lets you write infrastructure in TypeScript, Python, Go, or C# with full programming language features. Learn how Pulumi works, how it compares.
Flux GitOps Kubernetes Tutorial
Flux is a GitOps tool that continuously reconciles your Kubernetes cluster with a Git repository. Learn how to set up Flux, manage Helm releases, and handle.
Dagger CI/CD Pipelines as Code
Dagger lets you write CI/CD pipelines in real programming languages instead of YAML. Learn how Dagger works, how it compares to GitHub Actions.
Data Sovereignty Infrastructure
Implement data sovereignty with multi-region cloud infrastructure, GDPR compliance patterns, and geopatriation strategies for regulated workloads.
Debian 13 Trixie: Rock-Solid Linux
Debian 13 Trixie brings stability and reliability that enterprise servers demand. Learn why Debian remains the foundation of the Linux ecosystem.
Explore topics
Browse more articles on the topics covered here.