Manage Kubernetes cluster with Terraform and Argo CD

Click for: original source

In this article, you will learn how to create a Kubernetes cluster with Terraform and then manage it with Argo CD. Terraform is very useful for automating infrastructure. On the other hand, Argo CD helps us implement GitOps and continuous delivery for our applications. It seems that we can successfully combine both these tools. Let’s consider how they can help us to work with Kubernetes in the GitOps style.

Here’s the list of things you are going to do in this tutorial:

  • In the first step, we will create a local Kubernetes cluster using Terraform
  • Then we will install OLM (Operator Lifecycle Manager) on the cluster. We need it to install Kafka with Strimzi (Step 5)
  • We will use Terraform to install Argo CD from the Helm chart and create a single Argo CD Application responsible for the whole cluster configuration based on Git
  • After that, Argo CD Application installs Strimzi Operator, creates Argo CD Project dedicated to Kafka installation and Argo CD Application that runs Kafka on Kubernetes
  • Finally, the Argo CD Application automatically creates all the CRD objects required for running Kafka

Author wanted to define the whole cluster and store its configuration in Git. It was not possible to use only Argo CD to achieve it, because Argo CD must run on the existing Kubernetes cluster. That’s why a tool that is able to create a cluster and then install Argo CD there seems to be Terraform. It is perfect for a one-time activity like creating a cluster, but not for continuous tasks like app delivery and configuration management. Good read!

[Read More]

Tags cicd devops apis kubernetes cio