Ask HN: Have you switched from Terraform to Crossplane?

3 points by raffraffraff ↗ HN
I've seen how nasty a Terraform codebase can get at scale if you don't write good data-driven code. Module sprawl, state sprawl, drift. Even though I have found a nice data-driven approach that gets around many of it's problems, the Terraform DSL still has a few surprising "oofs" that get in my way (I'm talking specifically about features that don't work with `for_each`, like passing provider configs to modules, or lack of resource level dependency detection which throws dependency cycle errors where there are no cycles). Worse, some of these core terraform issues don't seem to get much attention, and the project maintainers have occasionally hinted that they don't have many development resources. All that said, I like Terraform. I'm just being honest about the gnarly side of using it at scale.

I like the idea of Crossplane (a reconciliation loop that keeps state correct, handling dependencies through retries). It's not gitops, but could be if you add ArgoCD or FluxCD. But doesn't Terraform + Atlantis give you somewhat the same. Why switch?

I have no idea what problems I will encounter at the same scale that I've been using Terraform. The demos and examples I've seen are simple day one problems that only show is benefits.

So: Have you gone all-in on Crossplane, built lots of configurations and composite resources etc? If so, what are it's real world issues?

3 comments

[ 3.3 ms ] story [ 18.7 ms ] thread
Glad to see I am not the only one who feels this way. The DSL is poorly designed to say the least. I don't understand why a whole new badly designed language has to be invented for tasks like this when the same thing could have been achieved using established languages that can also support declarative style programming.

But switching to anything else is going to be hard at this point because so much of the infra is already written with that poor DSL.

Nobody would approve spending the person-hours to be spent on migrating a working but complex infrastructure to a new codebase at this point.

I suppose I could have asked another way: if you have built large infrastructure in both Terraform and Crossplane, what problems have you encountered only in Crossplane.

The costly migration, in most cases, simply won't happen. In all likelihood, infra teams that are heavily invested in Terraform may pare back some of the infrastructure that's closer to the developers and replace it with Crossplane (ie: continue to deploy VPCs, subnets, peering, VPNs etc with Terraform, but let developers use Crossplane to deploy databases, queues, node groups etc)

Edit: swipe-style text input on my phone sometimes chooses very wrong words.

I've evaluated crossplane and one of the biggest drawbacks is not being able to properly diff your expected changes with your actual state. Basically there is no way to run a plan of your change. It's essentially a diff in a github pr, then you merge, sync with argocd, and hope your crossplane apply won't fail.

I prefer the terraform method where you are declarative, run plan and then apply. Ive worked with env0, terrafo cloud, spacelift, and atlantis. Ive worked with crossplane and argocd. So far my favorite has been to use terraform with a cicd solution.

Crossplane is too bleeding edge and will need some time for maturity. I do see crossplane or something similar once the edges have been fully polished.