Tools
Tools: From Terraform to Crossplane: How to Understand Crossplane if you already know Terraform?
2026-02-01
0 views
admin
The Automated Coffee Shop Analogy ## The "Dictionary" for Terraform Survivors ## WHAT actually installs the "atomic" resource? ## How does it improve upon my beloved Terraform? ## 1. Goodbye to "Drift" (Deviation) ## 2. Developer Self-Service ## 3. A Single Language: YAML ## The Elephant in the Room: Where is my "Terraform Plan", I F*****g Want to See What is Going to Happen Before It Happens! ## How to Sleep at Night (Solving the State Fear) ## Final Thoughts If you work in DevOps, Terraform is likely your favorite hammer. It’s reliable, solid, and has built your whole infrastructure (I hope so, at least). But suddenly, you start hearing about Crossplane, and you see diagrams with a thousand Kubernetes cubes, names like XRD and Compositions, and your brain just goes click: "Wait, why are there so many pieces just to do the same thing?". If you feel this way, don’t worry. It’s not that Crossplane is unnecessarily complex; it’s that we’ve shifted from writing infrastructure "scripts" to creating an "Operating System" for our cloud. Let’s break it down with the ultimate analogy so you never get lost again. Imagine you want to automate a coffee shop. This is where most people get lost. Let’s translate Crossplane concepts into what you already know from Terraform: This is the million-dollar question. How does that Bucket appear out of thin air? If Terraform already works, why change? This is where Crossplane shines: In Terraform, if someone manually deletes a resource in the AWS console, your infrastructure stays broken until the next plan/apply.
In Crossplane, the Provider is watching. If you delete the resource, Crossplane recreates it in less than 60 seconds automatically. Real auto-healing. Instead of devs asking you for changes in complex Terraform repos, you give them an interface (XRD). The dev only enters: image: my-app:v1. They don’t see (and don’t need to see) the 200 lines of network, security, and IAM configuration you’ve hidden inside the Composition. You no longer need to manage states (tfstate) in remote buckets with complex locks. The state of your infrastructure is the Kubernetes cluster itself. If Kubernetes is alive, your infrastructure is under control. Let’s be honest: moving to Crossplane can be terrifying. In Terraform, the plan is your safety net. You see exactly what will happen before it happens. In Crossplane, you apply a YAML, and the controller starts working. If you accidentally delete a K8s object that represents a Database... poof, your production data could vanish. This "fire and forget" nature is what keeps many DevOps away of Crossplane. Fortunately, there are ways to build a safety net as strong (or stronger) than Terraform’s: Don’t throw Terraform in the trash; it’s still great for static foundations (like creating the Kubernetes cluster itself). But for everything that lives and breathes (databases, queues, cloud apps), Crossplane is the next level of evolution. You go from being a "script writer" to a Platform Architect offering a catalog of living services to your company. What do you think of using Crossplane? Do you dare to take the leap to the Control Plane or do you use it already? Templates let you quickly answer FAQs or store snippets for re-use. Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink. Hide child comments as well For further actions, you may consider blocking this person and/or reporting abuse - In Terraform: You write a step-by-step recipe, execute it, and the kitchen serves a coffee. If someone drinks the coffee or drops the cup, the recipe does nothing until you go back to the kitchen and hit the "Execute" button again.
- In Crossplane: You hire a Barista (the Controller) who never stops watching the table. If the coffee disappears, he replaces it instantly without you saying a word. The Barista always ensures that reality matches the menu. - The Foundation (Provider): This is what we install first. When you install the GCP Provider, the cluster "learns" languages. Before, it only spoke "Kubernetes"; now, it speaks "Google Cloud." It installs the CRDs (the base dictionary).
- The Blueprint (Composition): You, as a platform expert, write a Composition. This is your standard. Here, you decide that all Buckets in your company must be private and located in europe-west3.
- The Order (Claim): A developer creates a 5-line YAML (the Claim).
- The Magic: The Provider sees the Claim, checks your Composition, and says: "Okay! I'm going to create the atomic resource (Managed Resource) in Google Cloud right now, based on the Composition." - The "Orphan" Policy (Technological): Every Managed Resource in Crossplane has a field called deletionPolicy. By setting it to Orphan instead of Delete, you are telling Crossplane: "If someone deletes this object in Kubernetes, DO NOT touch the resource in the Cloud". This is mandatory for Databases and stateful resources.
- ArgoCD as your "Plan" (Methodological): If you use GitOps (and you should), ArgoCD provides a visual Diff. Before syncing, you can see exactly what fields will change. It’s your new, visual, and much more readable terraform plan.
- Deletion Protection (Cloud Native): Just like in Terraform, you should enable deletionProtection: true on critical resources (SQL, GCS Buckets) at the Provider level. Even if Crossplane tries to delete it, the Cloud Provider will reject the request.
- Finalizers (Kubernetes Native): Kubernetes won't delete an object until its "Finalizers" are cleared. This gives you a window to catch accidental deletions before they reach the Cloud API.
how-totutorialguidedev.toaimlnetworkdatabasekubernetesk8sterraformgit