After five years of running Terraform in CI pipelines to manage everything from VPCs to RDS instances, I was tired of the same failure modes: state file corruption during a failed apply, drift that went unnoticed for weeks until an outage, and the inevitable bottleneck where only two senior engineers understood how to safely run targeted applies against production. When I first deployed Crossplane on a production EKS cluster in late 2022, I expected it to be just another wrapper around cloud APIs. What I found instead was a fundamentally different model for infrastructure provisioning — one where the Kubernetes control plane itself becomes the state manager, the drift detector, and the delivery mechanism. Crossplane doesn't just apply infrastructure; it continuously enforces it. That distinction has reshaped how my platform team delivers self-service infrastructure to 40+ application teams without becoming a ticket-driven bottleneck.
Why Control Loops Beat Pipelines for Infrastructure Lifecycle Management
In my experience, the most expensive bugs in infrastructure automation aren't creation failures — they're silent divergences that happen weeks later. With pipeline-based IaC like traditional Terraform, you declare desired state, run an apply, and hope nothing changes until the next pipeline execution. If someone manually modifies a security group in the AWS console at 2 AM during an incident, Terraform won't know until the next scheduled run or the next human-triggered apply. That gap is where outages breed.
Crossplane inverts this model by leveraging Kubernetes controllers. Every managed resource — whether it's an S3 bucket, a GCP CloudSQL instance, or an Azure resource group — is a Kubernetes custom resource with its own controller. That controller runs a reconciliation loop, constantly comparing observed state in the cloud provider against desired state in etcd. When they diverge, it remediates. You don't schedule drift detection; you get it for free as a property of the architecture.
From Imperative Applies to Declarative State Enforcement
The practical impact became clear to me when we migrated our non-production networking stack. With Terraform Cloud, we had a nightly drift detection job that would post Slack alerts. The alert was informational only — someone still had to triage, decide if the drift was intentional, and re-run a pipeline. With Crossplane, the same manual change to a VPC tag we introduced as a test was reverted within 90 seconds without human intervention. This is the same level-based logic that makes Kubernetes deployments self-healing, applied to infrastructure outside the cluster. The Kubernetes Documentation describes controllers as continuously driving actual state toward desired state, and Crossplane providers are textbook implementations of that pattern.
What Happens When Someone Mutates Resources Manually
That automatic remediation is powerful, but I've found that you need to be deliberate about it. Not all drift should be blindly reverted — sometimes an on-call engineer adds an emergency firewall rule for a reason. Crossplane provides management policies to control this. By setting managementPolicies: ["Observe"] you can run a resource in read-only mode, or use spec.forProvider field management to allow certain fields to be ignored. For incident response, we label critical compositions with a policy that pauses reconciliation, then re-enable it after review. This beats the Terraform workflow where you have to import the manual change into state or lose it on the next apply.
Architecting Provider Packages and Controller Isolation on EKS
Installing Crossplane is straightforward, but installing it in a way that survives upgrades, scales with your team, and doesn't give every developer cluster-admin is where most teams stumble. I run Crossplane on dedicated EKS clusters that act purely as control planes — they run no application workloads. This separation matters because a bad composition or a provider bug shouldn't be able to starve your production APIs.
Helm Installation and Provider Lifecycle Management
I install Crossplane via its official Helm chart with explicit resource requests and pod disruption budgets. The critical piece is how providers are managed as packages. Unlike Helm operators that bundle provider logic, Crossplane providers are OCI images installed as Provider resources. This means you can version, upgrade, and roll back a provider for AWS separately from one for GCP without touching the core Crossplane deployment.
# values.yaml for crossplane Helm chart
replicas: 3
resourcesCrossplane:
limits:
cpu: 2000m
memory: 2Gi
requests:
cpu: 500m
memory: 512Mi
podDisruptionBudget:
enabled: true
minAvailable: 2
---
# provider-aws.yaml - installed after Helm
apiVersion: pkg.crossplane.io/v1
kind: Provider
metadata:
name: provider-aws-s3
spec:
package: xpkg.upbound.io/upbound/provider-aws-s3:v1.8.0
revisionActivationPolicy: Automatic
revisionHistoryLimit: 3
I've learned to pin provider versions explicitly and disable automatic activation in production. In one incident, an automatic provider upgrade introduced a breaking change to the Bucket API that caused all our S3 claims to go into a degraded state. Since then, we mirror provider packages to our internal registry, test upgrades in a staging control plane, and promote them via ArgoCD. If you're already running declarative deployments with ArgoCD, the workflow described in GitOps with ArgoCD and Flux: Declarative Kubernetes Deployment maps directly — your Provider, ProviderConfig, and Composition manifests are just more GitOps-managed YAML.
Isolating Platform Teams with Namespaces and RBAC
The second lesson was tenancy. Crossplane runs cluster-scoped managed resources, but your users should interact with namespaced Claims. I create a namespace per business unit, bind RBAC so teams can only create Claims in their namespace, and use a separate namespace for the platform team to manage Compositions and XRDs. Service accounts for provider controllers are scoped via IRSA (IAM Roles for Service Accounts) on EKS, so a provider that manages S3 cannot touch IAM — least privilege is enforced at both the Kubernetes and cloud IAM layers.
Provider Configuration, Credential Injection and Multi-Cloud Realities
Credential handling is where Crossplane shows its Kubernetes-native roots and where insecure defaults can burn you. Early Crossplane examples all used static AWS access keys stored in Secrets. I would never do that in production today.
Credential Patterns I Actually Trust in Production
On AWS, the only pattern I recommend is IRSA. The provider controller assumes an IAM role via a projected service account token — no long-lived keys, rotation handled by STS, and fully auditable via CloudTrail. On GCP, workload identity federation is the equivalent, and on Azure, AAD Pod Identity or Workload Identity. For teams that must support multiple clouds from one control plane, each provider gets its own ProviderConfig that references a distinct secret or service account.
apiVersion: aws.upbound.io/v1beta1
kind: ProviderConfig
metadata:
name: aws-production
spec:
credentials:
source: InjectedIdentity
# alternative for non-IRSA: source: Secret with secretRef
region: us-east-1
---
apiVersion: s3.aws.upbound.io/v1beta1
kind: Bucket
metadata:
name: platform-logs-prod-us-east-1
annotations:
crossplane.io/external-name: platform-logs-prod-us-east-1
spec:
forProvider:
region: us-east-1
objectOwnership: BucketOwnerEnforced
versioningConfiguration:
status: Enabled
serverSideEncryptionConfiguration:
rules:
- applyServerSideEncryptionByDefault:
sseAlgorithm: aws:kms
providerConfigRef:
name: aws-production
managementPolicies:
- "*"
deletionPolicy: Orphan
A few hard-won details in that manifest: I explicitly set deletionPolicy: Orphan for stateful resources like buckets and databases. The default is Delete, which will delete the external bucket when you delete the Kubernetes manifest — a catastrophic footgun during a GitOps re-sync gone wrong. We had a junior engineer delete a Claim namespace that cascaded to deleting a staging bucket with audit logs. Since then, Orphan is mandatory for stateful resources and we use manual protection via admission webhooks. I also always set crossplane.io/external-name to control the physical resource name instead of letting it auto-generate.
Handling Multiple Environments Without Duplicating Config
ProviderConfigs become your environment boundary. I maintain aws-development, aws-staging, and aws-production ProviderConfigs each with IRSA roles that have permission boundaries scoped to account and region. A Composition can then select the ProviderConfig dynamically based on a label or a claim field, which eliminates the Terraform pattern of directory-per-environment with duplicated backend config. Compared to the backend and state migration strategies discussed in Terraform State Management: Remote Backends, Locking and State Migration, this is dramatically simpler — there is no remote state file to migrate, lock, or corrupt, because etcd *is* your state store, backed by the same backup and restore process you already use for your cluster.
Designing Composite Resources and Claims as Self-Service APIs
The real value of Crossplane isn't provisioning a single bucket — it's building platform abstractions. In my platform, application teams never create a raw Bucket or RDSInstance. They create a Claim for a XAppDatabase or XStaticWebsite, and the platform team owns the Composition that expands that claim into the full set of resources: database, parameter group, secrets, IAM policy, monitoring alarms, and backup vault.
Defining XRDs and Compositions That Platform Consumers Will Tolerate
The CompositeResourceDefinition (XRD) is your API schema. Keep it ruthlessly minimal. My early XRDs exposed 30+ fields because I tried to mirror every underlying provider option. Consumers were overwhelmed and just copied-pasted old YAML. The XRDs that actually get adopted expose maybe 5-7 fields: environment, size (small/medium/large mapped to instance types), compliance tier, and region. Everything else is defaulted or derived by the Composition. Think product, not pass-through.
apiVersion: apiextensions.crossplane.io/v1
kind: CompositeResourceDefinition
metadata:
name: xdatabases.platform.example.com
spec:
group: platform.example.com
names:
kind: XDatabase
plural: xdatabases
claimNames:
kind: DatabaseClaim
plural: databaseclaims
versions:
- name: v1alpha1
served: true
referenceable: true
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
properties:
parameters:
type: object
properties:
environment:
type: string
enum: ["dev", "staging", "prod"]
size:
type: string
enum: ["small", "medium", "large"]
engine:
type: string
enum: ["postgres", "mysql"]
required: ["environment", "size"]
---
apiVersion: apiextensions.crossplane.io/v1
kind: Composition
metadata:
name: database-aws-large
labels:
provider: aws
size: large
spec:
compositeTypeRef:
apiVersion: platform.example.com/v1alpha1
kind: XDatabase
patchSets:
- name: common-fields
patches:
- fromFieldPath: metadata.name
toFieldPath: metadata.annotations[crossplane.io/external-name]
- fromFieldPath: spec.parameters.environment
toFieldPath: metadata.labels[environment]
resources:
- name: rds-instance
base:
apiVersion: rds.aws.upbound.io/v1beta1
kind: Instance
spec:
forProvider:
region: us-east-1
instanceClass: db.r6g.xlarge
allocatedStorage: 500
storageEncrypted: true
backupRetentionPeriod: 14
providerConfigRef:
name: aws-production
patches:
- type: FromCompositeFieldPath
fromFieldPath: spec.parameters.engine
toFieldPath: spec.forProvider.engine
- type: PatchSet
patchSetName: common-fields
connectionDetails:
- fromConnectionSecretKey: endpoint
- fromConnectionSecretKey: port
This Composition bridges the gap between what developers want ("give me a large postgres DB in prod") and what your organization requires (encryption, backups, correct VPC, tagging, deletion protection). The patch-and-transform engine handles 80% of cases. For the other 20%, I now use Composition Functions — Go programs or Python functions that replace the rigid patch YAML with imperative logic for complex transformations, like generating a unique subnet group name based on the claim's region and environment.
Versioning Compositions Without Breaking Consumers
Compositions are not versioned by default, which catches teams off guard. If you update a Composition to add a new managed resource (say, adding a CloudWatch alarm to your database composition), existing Composite Resources won't automatically get it until they are reconciled. Worse, if you change the XRD schema in a breaking way, existing Claims will fail validation. I've standardized on immutable Composition names with version labels (database-aws-v1-3-0) and use a mutating webhook to set compositionRef to the latest stable version for new Claims, while pinning existing ones. Old compositions remain until all referencing composites are migrated.
Continuous Reconciliation, Drift Handling and Day-2 Observability
Running infrastructure via controllers forces you to think about Day-2 operations differently. Terraform's model is apply-and-forget; Crossplane's is observe-and-enforce. That shift requires new runbooks and monitoring.
Tuning Poll Intervals, Event Propagation and Error Handling
By default, most Upbound official providers poll cloud APIs every 30-60 seconds, and controllers retry on error with exponential backoff. For stable resources like S3, that's fine. For something flappy like an RDS instance undergoing patching, aggressive polling can spam your API quotas and flood your Crossplane logs with transient errors. I set pollInterval: 5m for databases and 10m for network resources, while keeping 1m for fast-moving resources like IAM policies. You can tune this per ProviderConfig via controller args.
Observability is where many Crossplane adopters get surprised. kubectl get managed shows a unified view, but you need deeper signals. I scrape Crossplane metrics (exposed on :8080/metrics) into Prometheus — key alerts are crossplane_managed_resource_sync_total error rate, time since last successful sync, and provider pod restarts. We also forward Kubernetes events for managed resources to Loki, so you can see the full lifecycle: kubectl describe bucket will show events like CannotApply with provider API errors. This is far more debuggable than parsing a Terraform apply log after the fact.
Dealing With Resources That Shouldn't Auto-Heal
Not everything should be reconciled aggressively. For resources like aws_autoscaling_group desired capacity, if you let the Horizontal Pod Autoscaler or an external operator scale the group, Crossplane will fight it. For those fields, use managementPolicies: ["Observe", "LateInitialize"] or the ignoreChanges style functionality via the spec.forProvider.lifecycle.ignoreChanges pattern some providers support. Be explicit: document which fields are managed by Crossplane and which are externally managed, otherwise two controllers will oscillate indefinitely.
Crossplane in Production: Maturity, Cost and When It Is the Wrong Choice
After two years, I can say Crossplane has earned its place, but it is not a wholesale replacement for every Terraform workflow. The control plane overhead is real. Running three Crossplane pods plus provider pods per cloud service consumes dedicated nodes — I budget roughly 2 vCPU and 4GB RAM per provider family in production, plus etcd storage for potentially thousands of managed resource objects. On EKS, etcd can grow quickly if you have high cardinality resources like IAM policy attachments; I had to increase etcd quota and prune old managed resource revisions.
Debugging failed compositions is also harder than debugging a Terraform plan. A plan gives you a clear diff before anything happens. Crossplane's errors surface as status conditions and events after reconciliation attempts, which requires comfort with kubectl and controller logs. For brand-new infrastructure that needs careful review, I still run a dry-run via crossplane beta trace or render the Composition locally before applying.
The maturity gap shows in provider coverage. The Terraform AWS provider has thousands of resources and data sources; the Upbound AWS provider family is comprehensive but still lags on niche services. If you need a resource added in the last three months, you may find it missing and need to contribute or use the generic Terraform provider (provider-terraform) as a bridge — which itself reintroduces state file complexity. Check the provider docs and the Terraform Registry diff before committing.
| Capability | Crossplane | Terraform (Pipeline-Based) | Pulumi |
|---|---|---|---|
| State Storage | Kubernetes etcd; no external state file; native HA and backup | Remote backend (S3/DynamoDB, TFC); requires locking, versioning, and migration | Pulumi Service or self-managed backend (S3, etc.) |
| Drift Detection | Continuous, per-resource reconciliation loop; auto-remediation configurable | Explicit plan/refresh or scheduled job; manual remediation | Refresh + preview on demand; continuous via automation API |
| Self-Service Model | Claims with RBAC; developers use kubectl/GitOps without cloud credentials | Module calls in HCL; developers need Terraform access + cloud creds or wrapper | Code abstractions; requires SDK access and language toolchain |
| Language / Authoring | YAML for XRD/Composition + Go/Python functions; declarative composition | HCL / JSON; mature module ecosystem and registry | General-purpose languages (TS/Python/Go); real code, loops, testing frameworks |
| Failure Domain | Cluster availability; controller bugs can halt all reconciliations | CI runner availability; state corruption halts all applies | Similar to Terraform; state backend availability dominates |
| Best Fit | Platform teams offering Kubernetes-native self-service on shared control plane | Centralized IaC for broad resource coverage; batch provisioning | Teams wanting software engineering practices for infra with strong typing |
Where Crossplane undeniably wins is for platform teams that already live in Kubernetes. If your developers already deploy via GitOps, their mental model is already declarative — adding infrastructure Claims is a natural extension. If your organization is still heavily Terraform-based with extensive module libraries, a hybrid approach works well: keep Terraform for foundational landing zones and use Crossplane for dynamic, developer-facing services like databases, queues, and buckets. The decision framework in Pulumi vs Terraform: Infrastructure as Real Code vs Configuration is useful here — many of the same tradeoffs between real code and configuration apply when you evaluate whether Compositions or Pulumi components are the right abstraction for your team. And if you have invested in modularization patterns described in Terraform Modules: Design Patterns, Versioning and Registry Publishing, those design principles translate directly to designing reusable Compositions.
For details on resource lifecycle and provider APIs, I regularly reference the Terraform Documentation to compare provider arguments, since Crossplane's forProvider fields mirror Terraform schema almost exactly, and the Kubernetes Documentation on CustomResourceDefinitions for XRD validation patterns.
Frequently Asked Questions
Can Crossplane fully replace Terraform for all my infrastructure?
In most organizations, not immediately and not completely. Crossplane excels at Kubernetes-native self-service for dynamic resources like databases, storage, and managed services where continuous reconciliation is valuable. For foundational bootstrapping — like creating the EKS cluster that Crossplane itself runs on, or managing niche provider resources not yet covered — Terraform remains the safer choice. I've seen the most success with a hybrid model where Terraform provisions the control plane and landing zones, and Crossplane manages tenant-facing workloads. Over time as provider coverage improves, you can shift more workloads.
How do I handle secrets and connection strings from managed resources?
Managed resources that produce credentials (e.g., RDS endpoint, password) write them to a Kubernetes Secret referenced by writeConnectionSecretToRef on the managed resource or Claim. That Secret is created in the same namespace as the Claim or Composite Resource and is the official interface for application consumption. In my setup, External Secrets Operator then syncs those Secrets to AWS Secrets Manager or Vault for non-Kubernetes consumers, and I enforce short TTLs and automatic rotation via a Composition Function that rotates passwords on a schedule. Never expose connection secrets via status fields or configmaps.
What happens if my Crossplane cluster goes down? Do I lose my infrastructure?
No, your cloud infrastructure continues to run — Crossplane is a management plane, not a data plane. If the cluster is down, you lose the ability to create, update, or remediate drift, but existing buckets, databases, and networks are unaffected. This is analogous to losing your Terraform state backend: nothing is deleted, but you can't safely apply changes. That is why I run Crossplane on a multi-AZ EKS cluster with etcd backups to S3 and Velero, and I keep a cold disaster-recovery cluster that can be restored from backup. The managed resources are tagged with crossplane.io/claim-name annotations so they can be re-imported if needed.
How does Crossplane handle state locking and concurrent updates that Terraform struggles with?
Crossplane delegates concurrency control to Kubernetes API server mechanisms: optimistic concurrency via resourceVersion and etcd's consistent store. Two simultaneous updates to the same Claim result in one failing with a conflict error that the client retries, rather than a DynamoDB lock contention. There is no separate state lock file to become stale or require force-unlock. However, you still need to consider cloud-side rate limits — ten compositions creating RDS instances simultaneously can throttle AWS APIs, so I use provider-level rate limiting flags and limit parallelism via composition scheduling.