Crossplane VS Terraform
Tags: kubernetes, devops, sre
Published: 2023-07-17 13:00:00

In the last post, we talked about Crossplane and the fact that it can create resources for us in the cloud. Should it replace Terraform? In which case should I use one of them?

## Automation
One strength of Crossplane is **that it's an operator deployed in a Kubernetes cluster**, so it is always up, checking its resources.

For example, **if you update some parameters in AWS of a resource managed by Crossplane, Crossplane will update the resource with the parameter values it has**. If you **delete** this resource in AWS, **Crossplane will recreate it**.

So it's really helpful to avoid some manual changes or to be sure if some resources are always here.

The biggest strength of Crossplane is that you can create dynamic resources. As evoked in other posts, with an operator **you can deploy a complete stack with AWS and your Kubernetes cluster by only applying one resource instance!**

## Automation overkill
So doing all of this is really cool but **do you really need it?** Having something like this can make your infrastructure very complex!

If you want to use Crossplane, you **must have a Kubernetes cluster**, so if you haven't one, may be you should pass this option. Maintaining a Kubernetes cluster can be hard and take a lot of time. Especially if you can do the same automation stuff with **Ansible**.

Also if you want to use it to create only a resource once and never touch it, it's also overkill. As it's an OpenSource project and **it's still under developments** every features are not available for the moment, especially for High Availability or Disaster Recovery. Things which are possible through Terraform.

## When use Terraform or Crossplane?

Generally it's recommanded to use Terraform **to generate resources which are here to stay** *(a database, a Kubernetes cluster...)* or **if you haven't a Kubernetes cluster**.

Having a Kubernetes cluster in the cloud can be expensive, so it's another reason to avoid it just to use Crossplane.

About Crossplane, it's better to use it **for dynamic resources** *(dynamic deployment of a stack)* or **temporary resources**.

Of course, it's just recommandations and there's not only one solution. All depends on your context. But I hope these recommandations will help you to think about what you should use or not.

---

## Summary
Until now we did saw a lot of things from the concepts to advanced topics. As you can see, Kubernetes operators are a huge subject which *(at least)* must be known for automation purposes. But don't fall into something overkill.

That's why I wrote this post. Often when posts are made, it's only to expose a new tool, explain why it's cool to use it. And there are right, there are a lot of tools which are really good and can do a lot of things for you. But generally, all these tools ask to have some prerequisites which can add more complexity overall. So using good tools is nice, but knowing in which case/context you want to use a tool or another, is better. *(It's only my point of view)*

I hope it will help you and if you have any questions *(there are not dumb questions)* or some points are not clear for you, don't hesitate to add your question in the comments or to contact me directly on  [LinkedIn](https://www.linkedin.com/in/maxime-guilbert-14b6a5128/).


---

<center><h3>You want to support me?</h3></center>
<a href="https://www.buymeacoffee.com/mxguilbert7" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" height="41" width="174"></a>