This repository contains code for deploying infrastructure using Terraform. It creates a Kubernetes cluster in Google Cloud with two node pools: a default node pool for deploying the Hello World HTTP Server application and a logging node pool for logging this application.
Before running the Terraform code, make sure you have the following:
GCP_CREDENTIALS
environment variable)GCP_REGION
: the GCP region where the cluster will be createdGCP_PROJECT
: the name of the GCP projectCLUSTER_NAME
: the name of the Kubernetes clusterTo store the Terraform state, you need to create a Google Cloud Storage bucket. If you are creating the bucket in another project, grant access permissions to your service account using the following command:
gsutil acl ch -u <service accoiunt>:FC gs://<name of bucket>
This repository includes a GitHub Actions pipeline for automatic infrastructure deployment. The pipeline consists of the following stages:
terraform init
: Initializes Terraform and sets up the backend for storing the state.terraform plan
: Generates an execution plan for creating the infrastructure.terraform apply
: Applies the changes to create the infrastructure. This step requires manual intervention.