Deploying ARO using azurerm Terraform Provider
This content is authored by Red Hat experts, but has not yet been tested on every supported configuration.
Overview
Infrastructure as Code has become one of the most prevalent ways in which to deploy and install code for good reason, especially on the cloud. This lab will use the popular tool Terraform in order to create a clear repeatable process in which to install an Azure Managed Openshift(ARO) cluster and all the required components.
Terraform
Terraform is an open-source IaC tool developed by HashiCorp. It provides a consistent and unified language to describe infrastructure across various cloud providers such as AWS, Azure, Google Cloud, and many others. With Terraform, you can define your infrastructure in code and store it inside of git. This makes it easy to version, share, and reproduce.
This article will go over using the Terraform’s official azurerm provider in order to deploy an ARO Cluster into our Azure environment.
Azure’s Terraform Provider
Azurerm is one of Azure’s official Terraform provider, which contains the Azurerm Red Hat Openshift Cluster Module that is used for the deployment of Azure Managed Red Hat Openshift(ARO).
This lab will also be using resources from the azuread module .
Prerequisites
- Azure CLI
- Terraform
- ARO Pull Secret (Optional, but highly recommended)
Create an ARO Cluster
Clone down the example Terraform repository
Set some environment variables
Cluster configuration options can be found in the
variables.tffile, and you can see some more automated setting of these variables for different scenarios in theMakefile. However to get a basic public cluster we only need to set the followingNote: Update the variables to match your environment. Example set the pull secret to the file that you downloaded in the prerequisites.
Run Terraform to deploy the cluster
Note: Expect this to take up to 45 minutes to complete.
Eventually you’ll see the following
Fetch the credentials for the cluster
Log into the cluster
Cleanup
Terraform makes it very easy to clean up the resources when you’re finished with them.
When prompted type in
yes
Conclusion
This article demonstrates the deployment of OpenShift clusters in a consistent manner using Terraform and the azurerm provider. The provided configuration is highly adaptable, allowing for more intricate and customizable deployments. For instance, it could easily be modified for the use of a custom domain zone with your cluster.