The multi-cloud approach and useful tools for it like Kubernetes, Terraform & Ansible

Table of contents

When I started this series of articles I had something in mind, the way the cloud companies have categorized their services marketing strategies. It was a good starting point to organize what I wanted to say, but as I progressed with the series I realized there was more I should be saying. The focus of this last article is a bit different, it has to do with what’s now being called the Multi-Cloud. In a nutshell, the companies consuming cloud services have realized the best way to keep their bills under control is to use more than one provider.

When building multi-cloud solutions an important thing to keep in mind is orchestration. You want to have a way to describe your solution in a repeatable way. This can be accomplished in a lot of different ways, but the most popular technologies right now would be: Docker, Kubernetes, Ansible, Terraform, CircleCI (among many others). Each of these technologies is a world in itself, but I want to at least cover a couple of them to give an idea of what they offer because both let you describe your application stack.

Kubernetes

Kubernetes helps you to create solutions which you can move between providers, it is a container orchestrator. There were others, but it won the “war”. Using it you can describe your solution including details about logging, scaling, management, failover, self-healing, and more. So even though it is a new technology which will take some time to learn, it does give control over a lot of your stack and let you describe it in a way it will run exactly the same in different providers. Once you learn how to describe your solutions, you’ll write it once and that should mostly be it. You can move your solution between providers and it should run in the same way.

Technology underneath Kubernetes is containerization, you could even run Docker containers and orchestrate them with Kubernetes. But the recommendation is to use their own containers, Docker is usually used for local environments. Even though this technology was started by Google, today it is open source and pushed by a much larger community.

Terraform & Ansible

Terraform (from Hashicorp with recent license changes) has a different approach, it will allow you to describe your hardware solution and deploy to different providers. It has a common way to deal with the services within all major providers (AWS, GCS, Azure, etc…) and you can describe your “hardware” in a way it can be created in a repeatable way (called Infrastructure as code). This will only be part of your solution as you will need to run some configuration on the hardware after it was created. In most situations Ansible (OpenSource and acquired by Red Hat in 2015) will help you with that part of the task. There are other ways to do this, but this is the most cross-platform one right now.

So why use Terraform+Ansible when you can do everything in Kubernetes? More control. You can fine tune the hardware you want, and with that you can use different options which could help you reduce costs. But as always things come with a price, you’ll need to learn two technologies instead of one.

Other contestants

You can always use the native languages or tools of the cloud provider to create your hardware (ie. AWS Cloud Formation), you can use alternatives to Ansible as well (chef, puppet, etc…), and you even have alternatives which are simpler to use than Kubernetes and let you simply use your docker images (ie. Amazon Elastic Container Service). But the reason I mentioned specifically the above technologies is that they are the most popular, and there are good reasons for their popularity. So unless you have something legacy, I would suggest you start with these.

Let’s wrap it up

Most important takeaway from this article is that you now have technologies that will help you deal with the multi-cloud environment we are now living in. There are differences, complexities, but as you progress with your road into the cloud you’ll end up either being exposed or needing solutions like these.

Finally I would like to share a series of reports from Hashicorp (the company behind Vagrant and Terraform among other techs) which shares an annual view of the multi-cloud:
Welcome to the Multi-Cloud Era (2021)
Making Multi-Cloud Work (2022)
Cloud maturity drives operational efficiency (2023)

Series closing

This is the final article in the series, so I would like to share the links of the whole series:
The Cloud Shift
Moving to the cloud with IaaS
Embracing the cloud model for your Application Development
What if you don’t deal with infrastructure at all?

Thanks for reading!