Skip to main content
πŸŽ“ Claude Code Masterclass Learn AI-assisted development on Udemy β€” plus the companion book on Leanpub & Amazon. Start Learning
Crossplane vs Terraform: Infrastructure as Code
Platform Engineering

Crossplane vs Terraform 2026: Kubernetes IaC Comparison

Crossplane vs Terraform compared for infrastructure as code in 2026. Reconciliation vs plan/apply, GitOps, drift detection, Compositions vs modules, and.

LB
Luca Berton
Β· 3 min read

Terraform and Crossplane both manage cloud infrastructure as code. The difference is fundamental: Terraform runs on-demand (plan β†’ apply), Crossplane runs continuously (Kubernetes control loop). This shapes everything β€” drift handling, GitOps, team workflows, and failure modes.

Architecture

Terraform

Developer β†’ terraform plan β†’ Review β†’ terraform apply β†’ Cloud API β†’ Done
                                                              ↓
                                                    State file (S3/TFC)

Terraform is imperative-triggered: you run a command, it computes a diff, you approve, it applies. Between runs, nothing watches your infrastructure.

Crossplane

Developer β†’ kubectl apply β†’ Kubernetes β†’ Crossplane Controller β†’ Cloud API
                                ↑                                     ↓
                          etcd (state)  ←  Reconciliation loop  ←  Actual state

Crossplane is continuously reconciling: a controller watches desired state in etcd and actual state in the cloud, fixing any drift automatically.

Feature comparison

FeatureCrossplaneTerraform
Execution modelContinuous reconciliationOn-demand plan/apply
LanguageYAML (Kubernetes manifests)HCL
State storageKubernetes etcdState file (S3, TFC, local)
Drift detectionAutomatic, continuousManual (terraform plan)
Drift correctionAutomaticManual (terraform apply)
Provider ecosystem~100 providers4,000+ providers
ComposabilityCompositions (XRDs)Modules
GitOpsNative (ArgoCD/Flux apply YAML)Requires wrapper (Atlantis, TFC)
RBACKubernetes RBACTFC teams / custom
Secret managementKubernetes Secrets / External SecretsVariables, Vault integration
Preview changesLimited (dry-run)terraform plan (detailed)
Import existingYes (observe-only)terraform import
DestroyDelete the resource YAMLterraform destroy
Learning curveKubernetes + Crossplane conceptsHCL (moderate)

Drift handling

This is the most important practical difference:

Terraform: drift is invisible until you check

# Someone manually changed a security group in AWS console
# Terraform doesn't know until you run:
terraform plan

# Plan shows drift:
# ~ aws_security_group.web
#   ~ ingress.0.cidr_blocks: ["10.0.0.0/8"] β†’ ["0.0.0.0/0"]

# You manually fix it:
terraform apply

Between terraform apply runs, infrastructure can drift silently. If your team runs Terraform weekly, drift goes undetected for days.

Crossplane: drift is corrected automatically

# Someone manually changed the security group
# Crossplane detects the difference within seconds
# and reverts it to the desired state in the YAML

# You see it in events:
kubectl describe securitygroup.ec2.aws.upbound.io/web
# Events:
#   Synced: True (drift detected and corrected)

Crossplane closes the gap between desired and actual state continuously. For security-critical infrastructure, this is a significant advantage.

GitOps integration

Crossplane + ArgoCD (native)

# ArgoCD Application manages Crossplane resources
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: infrastructure
spec:
  source:
    repoURL: https://github.com/myorg/infra
    path: crossplane/production
  destination:
    server: https://kubernetes.default.svc
  syncPolicy:
    automated:
      selfHeal: true

Infrastructure is just more Kubernetes YAML β€” ArgoCD syncs it like any other resource.

Terraform + Atlantis (wrapper needed)

# atlantis.yaml
version: 3
projects:
  - name: production
    dir: terraform/production
    workflow: default
    autoplan:
      enabled: true

Terraform requires a wrapper tool (Atlantis, Terraform Cloud, Spacelift) to integrate with GitOps workflows. It works but is an additional system to manage.

Platform engineering with Crossplane

Crossplane’s killer feature for platform teams is Compositions β€” custom abstractions that hide cloud complexity:

# Platform team defines the API
apiVersion: apiextensions.crossplane.io/v1
kind: CompositeResourceDefinition
metadata:
  name: xdatabases.platform.example.com
spec:
  group: platform.example.com
  names:
    kind: XDatabase
  versions:
    - name: v1alpha1
      schema:
        openAPIV3Schema:
          properties:
            spec:
              properties:
                size:
                  type: string
                  enum: [small, medium, large]
                engine:
                  type: string
                  enum: [postgres, mysql]
---
# Composition maps the API to real cloud resources
apiVersion: apiextensions.crossplane.io/v1
kind: Composition
metadata:
  name: xdatabase-aws
spec:
  compositeTypeRef:
    apiVersion: platform.example.com/v1alpha1
    kind: XDatabase
  resources:
    - name: rds
      base:
        apiVersion: rds.aws.upbound.io/v1beta1
        kind: Instance
        spec:
          forProvider:
            engine: postgres
            instanceClass: db.t3.medium

Developers request:

apiVersion: platform.example.com/v1alpha1
kind: XDatabase
metadata:
  name: orders-db
spec:
  size: medium
  engine: postgres

They do not need to know about AWS RDS instance classes, subnet groups, or security groups. The platform team handles that in the Composition.

Terraform modules offer similar abstraction but lack the continuous reconciliation and Kubernetes-native RBAC.

When they work together

Many organizations use both:

  1. Terraform for foundational infrastructure β€” VPCs, accounts, DNS zones, Kubernetes clusters themselves
  2. Crossplane for application infrastructure β€” databases, caches, queues, buckets requested by development teams

This hybrid approach works because Terraform excels at one-time setup and Crossplane excels at ongoing management.

Decision guide

Choose Crossplane when:

  • You are building an internal developer platform with self-service APIs
  • Drift correction must be automatic, not manual
  • Your team already uses Kubernetes and GitOps (ArgoCD/Flux)
  • You want Kubernetes RBAC for infrastructure access control
  • Infrastructure is managed by the same pipeline as applications

Choose Terraform when:

  • You need the broadest provider ecosystem (4,000+ providers)
  • Your team already knows HCL and has existing Terraform codebases
  • You need detailed plan previews before any change
  • Terraform Cloud/Enterprise features matter (Sentinel policies, cost estimation, VCS integration)
  • Infrastructure changes are infrequent and do not need continuous reconciliation

Free 30-min AI & Cloud consultation

Book Now