
High-level difference (short)
- Terraform: declarative Infrastructure as Code (IaC) that runs on demand — changes occur when you execute Terraform commands.
- Crossplane: Kubernetes-native controllers that continuously reconcile external cloud resources to match Kubernetes manifests.
Example scenario: provision PostgreSQL on AWS
A developer wants a managed PostgreSQL instance on AWS. Below are two idiomatic ways to express and enact that desired state.Terraform — run-on-demand workflow
How it works- The developer writes HCL describing the AWS RDS instance.
- Running
terraform applycalls the AWS API, creates the RDS instance, and stores resource metadata in a state file (for exampleterraform.tfstate). - Terraform is declarative, but it only takes action when triggered by a human or CI automation.
- Terraform provisions an RDS instance on AWS and records details in the state file.
- Subsequent changes are applied only when Terraform is executed again.
- If someone disables backups directly in the AWS Console, the real resource diverges from the Terraform configuration.
- Terraform will not automatically detect or remediate that drift until a person or automation runs
terraform plan/terraform apply.
Crossplane — continuous reconciliation inside Kubernetes
How it works- Crossplane runs as one or more controllers inside your Kubernetes cluster.
- You express external cloud resources as Kubernetes custom resources (YAML manifests).
- Crossplane’s controllers observe these resources and call cloud provider APIs to create and maintain the external resources, continuously reconciling any drift.
- Acts like any Kubernetes controller: it watches the declared resource and keeps the external provider in the declared state.
- Detects and remediates drift (for example, if backups are disabled in the AWS Console, Crossplane will restore backups to match
backups: enabled). - Enables GitOps and Kubernetes-native workflows for cloud infrastructure (deploy via
kubectl, CI/CD, or Git reconciliation).
The core difference: Terraform declares desired state and requires an explicit run to apply changes. Crossplane declares desired state as Kubernetes resources and runs continuously inside the cluster to automatically reconcile external resources to match that state.
When to use each tool
-
Use Terraform when:
- You want ad-hoc or human-triggered provisioning.
- Your team prefers direct IaC runs (CLI/CI pipelines) and centralized state files.
- You manage a variety of infrastructure outside Kubernetes and prefer Terraform’s provider ecosystem.
-
Use Crossplane when:
- You want Kubernetes-native, declarative management of cloud resources.
- Continuous reconciliation and automatic drift remediation are required.
- You want to adopt GitOps patterns where infrastructure is reconciled by controllers in the cluster.
Quick comparison
Further reading and references
- Terraform: https://www.terraform.io
- Crossplane: https://crossplane.io
- Kubernetes concepts: https://kubernetes.io/docs/concepts/overview/what-is-kubernetes/
- kubectl reference: https://kubernetes.io/docs/reference/kubectl/overview/
- Amazon RDS: https://aws.amazon.com/rds/
- PostgreSQL: https://www.postgresql.org/
- YAML specification: https://yaml.org/spec/1.2/spec.html
- Terraform provides a powerful, provider-rich IaC workflow that runs when executed.
- Crossplane brings infrastructure into the Kubernetes reconciliation loop so your cluster continuously enforces the desired state for external resources.