Skip to main content
All right — welcome to another core topic in CNPA Domain 4: Infrastructure Provisioning with Kubernetes. This is a foundational area for modern platform engineering. In this lesson we’ll cover three major approaches that platform teams use to manage cloud resources in a Kubernetes-centric environment: Crossplane, Terraform/OpenTofu, and Cluster API. These are important concepts for the CNPA exam and for real-world platform design.
This lesson focuses on Kubernetes-native patterns and trade-offs between Crossplane, Terraform/OpenTofu, and Cluster API. Understanding when to use each will help you design self-service, GitOps-driven platforms.
Why re-think traditional provisioning? Consider this common scenario: your platform supports multiple development teams across AWS and Azure and needs to provide self-service provisioning for databases, storage, and networking — fast, without tickets — and integrated into the same GitOps workflow developers use for applications. You also want consistent behavior across clouds and Kubernetes-native integration.
A presentation slide titled "Platform Engineering Infrastructure Challenges in 2025" showing four modern platform requirements: Multi-Cloud Complexity, Developer Self-Service, GitOps Integration, and Kubernetes‑Native. Each requirement is shown in a colored card with a short explanatory line beneath.
The core goal is a single source of truth and developer self-provisioning that is GitOps-friendly and, ideally, Kubernetes-native. Below we describe three common approaches and how they differ by native integration, resource scope, and operational model.
A slide titled "Three Paths to Kubernetes-Native Infrastructure" showing three options—Crossplane (CNCF), OpenTofu/Terraform, and Cluster API (CNCF)—each with a short description of their approach. Below are gray labels for "Native Integration", "Resource Scope", and "Operational Model" and a KodeKloud copyright.

Crossplane — Kubernetes-native infrastructure control

Crossplane is a CNCF project that treats cloud resources as Kubernetes custom resources (CRDs). It runs controllers in-cluster to reconcile those CRs against cloud provider APIs, enabling a Kubernetes-native control plane for external resources. You can compose reusable infrastructure patterns (Compositions) and expose developer-friendly claim APIs (CompositeResourceDefinitions, XRDs). Benefits:
  • Cloud resources become first-class Kubernetes objects with continuous reconciliation.
  • Compositions let you package complex infrastructure patterns as templates.
  • GitOps-friendly and integrates with Kubernetes RBAC, admission controllers, and observability.
A slide titled "Crossplane – CNCF's Universal Cloud API" showing four colored feature boxes: Custom Resources, Reconciliation, Composition, and Multi-Cloud. Each box has a brief description of that feature (e.g., cloud resources as Kubernetes objects, continuous reconciliation, reusable composition templates, and a single API for multiple cloud providers).
Typical flow for a Database-as-a-Service with Crossplane:
  1. Define a CompositeResourceDefinition (XRD) that models what developers can request.
  2. Create a Composition template that maps the XRD to concrete cloud resources (e.g., RDS instance, network, secrets).
  3. Developers submit a claim (instance of the XRD) and Crossplane reconciles the Composition to provision resources.
A presentation slide titled "Crossplane in Action — Database-as-a-Service" showing a "Three-Step Provisioning Flow." The three steps shown are: Define Composite Resource Definition (XRD), Create Composition Template, and Developers Submit Claims.
Example: install a Crossplane AWS provider using Kubernetes YAML.
Example XRD (schema that defines what developers can request):
Platform teams like Crossplane because it enforces Kubernetes patterns (reconciliation, RBAC, GitOps) across infrastructure, enabling self-service claims, templated compositions, and standard monitoring.
A presentation slide titled "Why Platform Teams Choose Crossplane" listing four key benefits — Kubernetes-Native, GitOps Compatible, Self-Service, and Observability — each with a short explanatory note. The slide is branded © KodeKloud.

Terraform / OpenTofu — mature IaC with operator integrations

Terraform (HashiCorp) is the long-standing infrastructure-as-code tool using HCL and a large provider ecosystem. Terraform’s license change led to community forks such as OpenTofu (a community-driven fork of Terraform); OpenTofu aims to preserve an open-source path while maintaining compatibility with Terraform modules and HCL. Terraform/OpenTofu characteristics:
  • Mature ecosystem and provider coverage.
  • HCL language and state management (remote state backends).
  • Often used outside the cluster (CI/CD pipelines) or integrated into-cluster via operators.
You can run Terraform from CI (recommended for many teams), or use an in-cluster Terraform Operator that exposes Terraform runs via CRs. A typical pattern is to keep Terraform modules as the canonical module source and trigger runs from a GitOps pipeline or operator.
A slide titled "Three Paths to Kubernetes-Native Infrastructure" showing three options—Crossplane (CNCF), OpenTofu/Terraform, and Cluster API (CNCF)—each with a short description of their approach. Below are gray labels for "Native Integration", "Resource Scope", and "Operational Model" and a KodeKloud copyright.
Example of a Terraform custom resource that triggers an in-cluster Terraform operator:
Notes on trade-offs:
  • Terraform/OpenTofu have broad provider coverage and module ecosystems.
  • They are not inherently Kubernetes-native; you integrate them into GitOps workflows or run them from CI/CD.
  • Crossplane provides tighter Kubernetes-native reconciliation, but Terraform has a lower initial learning curve for many teams and more mature provider modules.

Cluster API — declarative cluster lifecycle management

Cluster API (CAPI) is a CNCF project that focuses on Kubernetes cluster lifecycle management (provisioning, scaling, upgrades, machine lifecycle) using Kubernetes-style declarative APIs. It’s effectively “Kubernetes managing Kubernetes” — controllers in a management cluster reconcile Cluster and Machine CRs to provision and operate workload clusters.
A presentation slide titled "Cluster API – Managing Kubernetes With Kubernetes." It shows four colored feature boxes—Cluster Provisioning, Node Management, Cluster Upgrades, and Multi‑Cloud—with brief descriptions about creating clusters, scaling nodes, automated version upgrades, and multi‑cloud management.
Cluster API is best suited for:
  • Cluster lifecycle: creating, upgrading, and scaling Kubernetes clusters.
  • Multi-cloud/hybrid/edge consistent cluster management.
  • Use-cases where you want cluster standardization and automation of node and control-plane lifecycle.
Cluster API components include management cluster controllers, control plane controllers, machine controllers, and MachineHealthCheck controllers that automate node lifecycle and control plane operations.
A slide titled “Cluster API Components – Controllers and Machines” showing four component types—Management Cluster, Workload Clusters, Machine Controllers, and Control Plane Controllers—each with a short description of its role.
Cluster API example: a Cluster resource that references an AWS infrastructure provider to declare a Kubernetes cluster.
Key point: Cluster API is focused on clusters themselves. It is not a general-purpose cloud resource orchestrator like Crossplane or Terraform. You’ll often combine Cluster API with Crossplane or Terraform for underlying networking and cloud resources.
A presentation slide titled "When to Use Cluster API for Platform Engineering" showing three colored callouts: "Multi‑Tenant Platforms" (provide dedicated clusters per team), "Edge and Hybrid" (manage clusters across on‑premises and cloud), and "Cluster Standardization" (ensure consistent cluster configurations).

Comparing the three approaches

  • Crossplane: Kubernetes-native, manages a wide range of cloud resources via CRDs and Compositions; excellent for GitOps-driven, self-service platforms. Requires deeper Kubernetes expertise to design compositions effectively.
  • Terraform/OpenTofu: Mature IaC, extensive provider ecosystem and modules, generally managed outside the cluster (or integrated via operators). Familiar, approachable HCL workflow and broad community adoption.
  • Cluster API: Specialized for Kubernetes cluster lifecycle management. Narrow scope but deep capability for cluster provisioning, scaling, and upgrades.
A slide titled "Choosing the Right Tool — Crossplane vs Terraform vs Cluster API" showing an "Infrastructure Scope" comparison: Crossplane supports any cloud resource (databases, storage, networking, clusters), Terraform supports any cloud resource across providers, and Cluster API targets Kubernetes clusters exclusively.
Team expertise considerations:
A presentation slide titled "Choosing the Right Tool – Crossplane vs Terraform vs Cluster API" that summarizes required team expertise. It lists Crossplane (deep Kubernetes knowledge, composition design), Terraform (HCL proficiency, state management), and Cluster API (Kubernetes knowledge, cluster operations expertise).
  • Crossplane: deep Kubernetes skills, composition design, and provider wiring.
  • Terraform/OpenTofu: HCL proficiency, state and module management; easier ramp for many teams.
  • Cluster API: Kubernetes and cluster operations experience — focused but narrower in scope.

Patterns and best practices (2025)

Aim for layered abstractions and GitOps-first workflows. Reusable compositions and modules reduce one-off “unicorns.” Policy-as-code and built-in observability ensure compliance and operational visibility across teams.
A slide titled "2025 Best Practices – Infrastructure Provisioning Patterns." It lists five numbered practices with brief explanations: Layered Abstractions, GitOps Everything, Composition Over Configuration, Policy as Code, and Observability Built‑In.
Implementation guidance (example timeline):
  1. Start experimenting with Cluster API to standardize and manage cluster lifecycles.
  2. Add Crossplane to model application infrastructure as Kubernetes resources and provide self-service compositions.
  3. Keep Terraform/OpenTofu for complex foundational networking, or for teams that already rely on a large Terraform module ecosystem.
  4. Expose multiple abstraction levels (platform operators, SREs, and developers) according to persona.
A slide titled "2025 Best Practices – Infrastructure Provisioning Patterns" showing an "Implementation Guidelines" timeline with four numbered steps. The recommendations are: start with Cluster API for cluster management, add Crossplane for application infrastructure, keep Terraform for complex networking and foundational resources, and provide multiple abstraction levels for different user personas.
At SparklePonyRanch, the team roles reflect these choices: Swati (SRE) focuses on SLOs/SLA and Cluster API for cluster operations; Alan (Infrastructure) maintains Terraform/OpenTofu modules and Crossplane compositions for application infrastructure; Phuong (Developer) consumes the self-service APIs and GitOps workflows.
A presentation slide titled "SPR Platform Team Infrastructure Strategy" showing three colored avatar icons labeled Swati (SRE), Alan (Infrastructure), and Phuong (Developer) with brief bullet-point responsibilities under each. The slide also features a "Sparkle Pony Ranch" tag above the center avatar.

Key takeaways

  • Crossplane (CNCF): represents Kubernetes-native infrastructure control using CRDs and composition patterns; ideal when you want infrastructure as Kubernetes objects and tight GitOps integration.
  • Terraform / OpenTofu: mature IaC ecosystem using HCL and modules; often the quickest way to adopt IaC at scale and has the largest provider coverage.
  • Cluster API (CNCF): specialized for Kubernetes cluster lifecycle management — provisioning, upgrading, scaling — and not a general cloud resource orchestrator.
  • Design your platform with layered abstractions, GitOps, policy-as-code, and observability to enable self-service while preserving security and compliance.
A presentation slide titled "Key Takeaways – Infrastructure Provisioning" showing three boxed summaries for Crossplane, Cluster API, and OpenTofu/Terraform. Each box gives a short description of the project's role in Kubernetes or infrastructure-as-code (e.g., cloud resources as CRs, cluster lifecycle management, and mature IaC with Kubernetes integration).
A slide titled "Key Takeaways – Infrastructure Provisioning" listing four essential concepts for CNPA certification: 01 GitOps Integration, 02 Self-Service Goal, 03 Observability, and 04 Composition Patterns, each shown in colored rounded boxes with brief explanations.
A presentation slide titled "Key Takeaways – Infrastructure Provisioning" showing "Platform Value" bullets: Kubernetes-native provisioning, enables developer self-service, and ensures operational excellence. The slide includes a faint gear/server illustration and a © KodeKloud notice.
Thanks for reading.

Watch Video