Show HN: Terraform GitHub Action Runner Wrapper
GitHub - adefemi171/terraform-gha: An Infrastructure as Code (IaC) repository to simplify and secure the use of GitHub Actions Runner on Kubernetes Cluster (Local Cluster, AWS, GCP, Azure)
TERRAFORM GHA (GitHub Actions) Runners
Getting Started
This Terraform project allows user create a Kubernetes Cluster with GitHub Action Runner Controller installed running on any cloud provider (currently support AWS) or locally using Kubernetes-in-Docker (KIND) or Minikube.
It supports two main use cases:

DinD (Docker in Docker): Deploying GitHub Actions Runner using Docker in Docker as the Container Mode.
Kubernetes: Deploying GitHub Actions Runner using Kubernetes as the Container Mode.

The project currently supports running GitHub Actions Runner on the following platforms:

AWS EKS: Deploying GitHub Actions Runner Controller on AWS EKS.
KinD: Deploying GitHub Actions Runner Controller on KinD.
Minikube: Deploying GitHub Actions Runner Controller on Minikube.

ImportantBefore running the Terraform commands, make sure to update the terraform.tfvars file with the right githubConfigUrl and github_token. Lastly, if you will be using GitHub ARC images, make sure to login to the GitHub Container Registry (GHCR) using the docker login ghcr.io -u username -p accesstoken command.

Supported Providers
Building for all available cloud and deployment platforms is the main goal of this project. Any user should be able to deploy the same tools and simply switch between cloud providers and runtime environments (Windows or Linux).
Currently a lot of work is been done around EKS, KinD, Minikube
This project will be supporting the following providers:


 AWS


 GCP


 Azure


 Oracle Cloud


 IBM Cloud


 Digital Ocean


 RedHat OpenShift


 Kubernetes

 EKS
 GKE
 AKS
 OKE
 IKS
 DOKS
 OpenShift



 Bare metal (such as Hetzner)


 Openstack


 kind


 minikube


 k3s


 Rancher


Deploying to AWS EKS
Requirements for AWS EKS
The following tools are required for deploying GitHub Actions Runner Controller on AWS EKS (tested only on public clusters):

docker (up and running)
awscli
aws secret and access key
kubectl
eksctl
terraform (1.0+)
helm (3.0+)
make

Using Container Mode as DinD in AWS EKS
The bootstrapping and configuration of cluster can be performed with the command:
cd aws/dind
terraform init
terraform apply -var-file=terraform.tfvars
To update the cluster, there are variables that can be changed, and it is located in the terraform.tfvars.
Using Container Mode as Kubernetes in AWS EKS
The bootstrapping and configuration of cluster can be performed with the command:
cd aws/k8s
terraform init
terraform apply -var-file=terraform.tfvars
To update the cluster, there are variables that can be changed, and it is located in the terraform.tfvars.
Deploying to KinD
Requirements for KinD
The following tools are required for deploying GitHub Actions Runner Controller on KinD:

docker (up and running)
terraform (1.0+)
helm (3.0+)
kind
make

Using Container Mode as DinD in KinD
The bootstrapping and configuration of cluster can be performed with the command:
cd kind/dind
terraform init
terraform apply -var-file=terraform.tfvars
To update the cluster, there are variables that can be changed, and it is located in the terraform.tfvars.
Using Container Mode as Kubernetes in KinD
The bootstrapping and configuration of cluster can be performed with the command:
cd kind/k8s
terraform init
terraform apply -var-file=terraform.tfvars
To update the cluster, there are variables that can be changed, and it is located in the terraform.tfvars.
Deploying to Minikube
Requirements for Minikube
The following tools are required for deploying GitHub Actions Runner Controller on Minikube:

docker (up and running)
terraform (1.0+)
helm (3.0+)
minikube
make

Using Container Mode as DinD in Minikube
The bootstrapping and configuration of cluster can be performed with the command:
cd minikube/dind
terraform init
terraform apply -var-file=terraform.tfvars
To update the cluster, there are variables that can be changed, and it is located in the terraform.tfvars.
Using Container Mode as Kubernetes in Minikube
The bootstrapping and configuration of cluster can be performed with the command:
cd minikube/k8s
terraform init
terraform apply -var-file=terraform.tfvars
To update the cluster, there are variables that can be changed, and it is located in the terraform.tfvars.
Alternative: using Makefile
To simplify the execution of the commands, a Makefile is available and this is used to perform the terraform commands seamlessly. All you need to do is to type from the root folder:

To create a GitHub Actions Runner on any of the platform currently supported, type:
make create-<platform>-<container_mode>
To delete the GitHub Actions Runner on any of the platform currently supported, type:
make cleanup-<platform>-<container_mode>
Usage
Once the cluster is up and running, you can use the github actions runner in your workflow by changing the runs-on in your workflow file to the name of the runner you created.
jobs:
  build:
    runs-on: self-hosted
