Using a Kubernetes controller as a Terraform reconciliation loop
In the previous chapter’s recipes, we learned how to use Terraform to deploy a Docker container, provision a Kubernetes cluster, and deploy applications in Kubernetes using different tools.
In this recipe, we will learn how to perform a reconciliation loop to provision infrastructure using Terraform and reapply the Terraform workflow at each code change.
By using Terraform reconciliation, you can:
- Ensure that the state of your infrastructure always matches the desired state defined in the Terraform code.
- Automate the deployment of infrastructure resources based on changes to the Git repository, reducing the risk of errors and improving the speed of deployments.
So, we will learn in this recipe how to apply infrastructure changes coded with Terraform using a Kubernetes controller in Kubernetes.
Let’s get started!
Getting ready
To complete this recipe, we need...