→ Back to Home
Crossplane

Architecting Hybrid Crossplane and Terraform Control Planes Without HCL Rewrites

DevOps Inside published an architectural deep dive detailing how platform teams can implement a hybrid control plane combining Crossplane and Terraform without discarding existing HCL codebases. Using Crossplane's provider-terraform (v1.2.0) and namespaced Workspace custom resources under tf.m.upbound.io/v1beta1, platform engineers can expose custom Composite Resource Definitions (XRDs) via apiextensions.crossplane.io/v2 while dispatching the underlying execution to remote Terraform modules. The pattern leverages Crossplane's modern Pipeline mode and Composition Functions rather than legacy resource modes, translating declarative Kubernetes requests into parameterized Terraform variable inputs. This blueprint directly addresses the primary hurdle preventing enterprises from adopting Kubernetes-native control planes: the migration penalty. Rewriting years of hardened Terraform modules into pure Crossplane Managed Resources is prohibitively expensive and risky for established platform engineering groups. By wrapping existing Terraform assets behind custom Crossplane XRDs, platform architects can immediately provide self-service, schema-validated Kubernetes APIs to application developers. It creates a clean boundary where developers interact exclusively with declarative control planes, while infrastructure teams retain their existing state files, security policies, and battle-tested module catalogs. The broader infrastructure industry has reached an inflection point where static Infrastructure as Code (IaC) pipelines are colliding with the demands of continuous reconciliation and platform engineering. Traditional CI/CD-driven Terraform runs are point-in-time executions that struggle with drift detection, complex multi-resource dependencies, and native Kubernetes RBAC integration. However, wholesale migrations rarely succeed in large enterprises. Hybrid architectures represent the pragmatic middle ground currently gaining traction across the CNCF ecosystem, allowing organizations to adopt control plane semantics incrementally while preserving historical investments in tooling, state locking backends, and cloud provider modules. In practice, engineers implementing this pattern must navigate critical operational trade-offs. Most notably, wrapping Terraform in a Crossplane Workspace does not instantly provide real-time drift reconciliation; provider-terraform defaults to polling Workspaces every 10 minutes to execute terraform plan, meaning drift detection is batched rather than immediate. Platform teams must also account for rigid data type conversions between YAML definitions and HCL variables, as well as maintaining robust state backend persistence. Teams should utilize this hybrid pattern as a transitional bridge—standardizing their API surface first with namespaced XRDs, and selectively migrating high-frequency resources to native Crossplane providers only when reconciliation latency warrants it.
#crossplane#terraform#platform engineering#kubernetes#infrastructure as code
Read original source