diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3835030..5c7502f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -11,8 +11,4 @@ Yayyy, You are all done with the steps! Now just sit back and watch while your Pull request is reviewed and ultimately merged. 🎊 - - - - ##### Thanks! again for the contribution!🙏 \ No newline at end of file diff --git a/Makefile b/Makefile index e60ffdf..4129690 100644 --- a/Makefile +++ b/Makefile @@ -33,96 +33,108 @@ help: .PHONY: create-aws-dind create-aws-dind: - cd aws/dind - terraform init -upgrade + cd aws/dind && \ + terraform init -upgrade && \ terraform apply -auto-approve -var-file=terraform.tfvars .PHONY: create-aws-k8s create-aws-k8s: - cd aws/k8s - terraform init -upgrade + cd aws/k8s && \ + terraform init -upgrade && \ terraform apply -auto-approve -var-file=terraform.tfvars .PHONY: create-kind-dind create-kind-dind: - cd kind/dind - terraform init -upgrade + cd kind/dind && \ + terraform init -upgrade && \ terraform apply -auto-approve -var-file=terraform.tfvars .PHONY: create-kind-k8s create-kind-k8s: - cd kind/k8s - terraform init -upgrade + cd kind/k8s && \ + terraform init -upgrade && \ terraform apply -auto-approve -var-file=terraform.tfvars .PHONY: create-minikube-dind create-minikube-dind: - cd minikube/dind - terraform init -upgrade + cd minikube/dind && \ + terraform init -upgrade && \ terraform apply -auto-approve -var-file=terraform.tfvars .PHONY: create-minikube-k8s create-minikube-k8s: - cd minikube/k8s - terraform init -upgrade + cd minikube/k8s && \ + terraform init -upgrade && \ terraform apply -auto-approve -var-file=terraform.tfvars .PHONY: cleanup-aws-dind cleanup-aws-dind: - cd aws/dind - terraform destroy -auto-approve -var-file=terraform.tfvars - rm -f *-config || echo "File not found, skipping" + cd aws/dind && \ + terraform destroy -auto-approve -var-file=terraform.tfvars && \ + rm -f *-config || echo "Config file not found, skipping" && \ + rm -f *.tfstate || echo "State file not found, skipping" && \ + rm -f *.tfstate.backup || echo "State backup file not found, skipping" .PHONY: cleanup-aws-k8s cleanup-aws-k8s: - cd aws/k8s - terraform destroy -auto-approve -var-file=terraform.tfvars - rm -f *-config || echo "File not found, skipping" + cd aws/k8s && \ + terraform destroy -auto-approve -var-file=terraform.tfvars && \ + rm -f *-config || echo "Config file not found, skipping" && \ + rm -f *.tfstate || echo "State file not found, skipping" && \ + rm -f *.tfstate.backup || echo "State backup file not found, skipping" .PHONY: cleanup-kind-dind cleanup-kind-dind: - cd kind/dind - terraform destroy -auto-approve -var-file=terraform.tfvars - rm -f *-config || echo "File not found, skipping" + cd kind/dind && \ + terraform destroy -auto-approve -var-file=terraform.tfvars && \ + kind delete clusters --all && \ + rm -f *-config || echo "Config file not found, skipping" && \ + rm -f *.tfstate || echo "State file not found, skipping" && \ + rm -f *.tfstate.backup || echo "State backup file not found, skipping" .PHONY: cleanup-kind-k8s cleanup-kind-k8s: - cd kind/k8s - terraform destroy -auto-approve -var-file=terraform.tfvars - rm -f *-config || echo "File not found, skipping" + cd kind/k8s && \ + terraform destroy -auto-approve -var-file=terraform.tfvars && \ + kind delete clusters --all && \ + rm -f *-config || echo "Config file not found, skipping" && \ + rm -f *.tfstate || echo "State file not found, skipping" && \ + rm -f *.tfstate.backup || echo "State backup file not found, skipping" .PHONY: cleanup-minikube-dind cleanup-minikube-dind: - cd minikube/dind - terraform destroy -auto-approve -var-file=terraform.tfvars - rm -f *-config || echo "File not found, skipping" + minikube delete --all && \ + cd minikube/dind && \ + rm -f *.tfstate || echo "State file not found, skipping" && \ + rm -f *.tfstate.backup || echo "State backup file not found, skipping" .PHONY: cleanup-minikube-k8s cleanup-minikube-k8s: - cd minikube/k8s - terraform destroy -auto-approve -var-file=terraform.tfvars - rm -f *-config || echo "File not found, skipping" + minikube delete --all && \ + cd minikube/k8s && \ + rm -f *.tfstate || echo "State file not found, skipping" && \ + rm -f *.tfstate.backup || echo "State backup file not found, skipping" .PHONY: plan-kind-dind plan-kind-dind: - cd kind/dind - terraform init -upgrade + cd kind/dind && \ + terraform init -upgrade && \ terraform plan -var-file=terraform.tfvars .PHONY: plan-kind-k8s plan-kind-k8s: - cd kind/k8s - terraform init -upgrade + cd kind/k8s && \ + terraform init -upgrade && \ terraform plan -var-file=terraform.tfvars .PHONY: plan-minikube-dind plan-minikube-dind: - cd minikube/dind - terraform init -upgrade + cd minikube/dind && \ + terraform init -upgrade && \ terraform plan -var-file=terraform.tfvars .PHONY: plan-minikube-k8s plan-minikube-k8s: - cd minikube/k8s - terraform init -upgrade + cd minikube/k8s && \ + terraform init -upgrade && \ terraform plan -var-file=terraform.tfvars \ No newline at end of file diff --git a/README.md b/README.md index c8119eb..3a81ff0 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,8 @@ The project currently supports running GitHub Actions Runner on the following pl 1. **KinD:** Deploying GitHub Actions Runner Controller on KinD. 1. **Minikube:** Deploying GitHub Actions Runner Controller on Minikube. -> ⚠️ **Before running the Terraform commands, make sure to update the `terraform.tfvars` file with the right `githubConfigUrl` and `github_token`.** +> [!IMPORTANT] +> Before 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 @@ -178,3 +179,13 @@ To delete the GitHub Actions Runner on any of the platform currently supported, ```sh make cleanup-- ``` + +### 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. + +```yaml +jobs: + build: + runs-on: self-hosted +``` diff --git a/actions-arc-dind-chart/main.tf b/actions-arc-chart/main.tf similarity index 100% rename from actions-arc-dind-chart/main.tf rename to actions-arc-chart/main.tf diff --git a/actions-arc-dind-chart/variables.tf b/actions-arc-chart/variables.tf similarity index 100% rename from actions-arc-dind-chart/variables.tf rename to actions-arc-chart/variables.tf diff --git a/actions-arc-k8s-chart/main.tf b/actions-arc-k8s-chart/main.tf deleted file mode 100644 index 523fa05..0000000 --- a/actions-arc-k8s-chart/main.tf +++ /dev/null @@ -1,29 +0,0 @@ -resource "helm_release" "actions_arc_controller" { - namespace = var.arc_controller_namespace - create_namespace = true - - name = "arc-systems" - repository = "oci://ghcr.io/actions/actions-runner-controller-charts" - chart = "gha-runner-scale-set-controller" - version = var.arc_controller_chart_version -} - -resource "helm_release" "actions_arc_runner" { - namespace = var.arc_runner_namespace - create_namespace = true - - name = "arc-runners" - repository = "oci://ghcr.io/actions/actions-runner-controller-charts" - chart = "gha-runner-scale-set" - version = var.arc_runner_chart_version - - dynamic "set" { - for_each = var.arc_runner_config - content { - name = set.value["name"] - value = set.value["value"] - } - } - - depends_on = [helm_release.actions_arc_controller] -} diff --git a/actions-arc-k8s-chart/variables.tf b/actions-arc-k8s-chart/variables.tf deleted file mode 100644 index 37f96cc..0000000 --- a/actions-arc-k8s-chart/variables.tf +++ /dev/null @@ -1,14 +0,0 @@ -variable "arc_controller_namespace" {} - -variable "arc_controller_chart_version" {} - -variable "arc_runner_namespace" {} - -variable "arc_runner_chart_version" {} - -variable "arc_runner_config" { - type = list(object({ - name = string - value = string - })) -} diff --git a/aws/dind/main.tf b/aws/dind/main.tf index 249013d..e303c3b 100644 --- a/aws/dind/main.tf +++ b/aws/dind/main.tf @@ -43,7 +43,7 @@ module "actions_role" { } module "actions_actions_arc_chart" { - source = "../../actions-arc-dind-chart" + source = "../../actions-arc-chart" arc_controller_namespace = var.arc_controller_namespace arc_controller_chart_version = var.arc_controller_chart_version diff --git a/aws/dind/terraform.tfvars b/aws/dind/terraform.tfvars index a6d249c..641f9ff 100644 --- a/aws/dind/terraform.tfvars +++ b/aws/dind/terraform.tfvars @@ -1,6 +1,6 @@ # Cluster Config Variables cluster_name = "actions-cluster" -cluster_version = "1.29" +cluster_version = "1.30" cluster_endpoint_public_access = true managed_node_groups_name = "actions-node-group" node_group_defaults_instance_types = ["t2.medium", "t3a.medium", "t3.xlarge"] @@ -28,10 +28,10 @@ ebs_service_account_name = "ebs-controller-sa" #ARC Chart Variables arc_controller_namespace = "arc-systems" -arc_controller_chart_version = "0.7.0" +arc_controller_chart_version = "0.9.3" arc_runner_namespace = "arc-runners" -arc_runner_chart_version = "0.7.0" +arc_runner_chart_version = "0.9.3" arc_runner_config = [{ name = "githubConfigUrl" value = "https://github.com/" # This is a dummy repo diff --git a/aws/k8s/main.tf b/aws/k8s/main.tf index 530f15c..874b562 100644 --- a/aws/k8s/main.tf +++ b/aws/k8s/main.tf @@ -51,7 +51,7 @@ module "actions_ebs_chart" { } module "actions_actions_arc_chart" { - source = "../../actions-arc-k8s-chart" + source = "../../actions-arc-chart" arc_controller_namespace = var.arc_controller_namespace arc_controller_chart_version = var.arc_controller_chart_version diff --git a/aws/k8s/terraform.tfvars b/aws/k8s/terraform.tfvars index 2079f3c..acb0722 100644 --- a/aws/k8s/terraform.tfvars +++ b/aws/k8s/terraform.tfvars @@ -1,6 +1,6 @@ # Cluster Config Variables cluster_name = "actions-cluster" -cluster_version = "1.29" +cluster_version = "1.30" cluster_endpoint_public_access = true managed_node_groups_name = "actions-node-group" node_group_defaults_instance_types = ["t2.medium", "t3a.medium", "t3.xlarge"] @@ -32,10 +32,10 @@ open_ebs_namespace = "openebs" #ARC Chart Variables arc_controller_namespace = "arc-systems" -arc_controller_chart_version = "0.7.0" +arc_controller_chart_version = "0.9.3" arc_runner_namespace = "arc-runners" -arc_runner_chart_version = "0.7.0" +arc_runner_chart_version = "0.9.3" arc_runner_config = [{ name = "githubConfigUrl" value = "https://github.com/" # This is a dummy repo diff --git a/kind/dind/main.tf b/kind/dind/main.tf index 4297d97..16131b7 100644 --- a/kind/dind/main.tf +++ b/kind/dind/main.tf @@ -9,7 +9,7 @@ module "action_cluster" { module "actions_actions_arc_chart" { - source = "../../actions-arc-dind-chart" + source = "../../actions-arc-chart" arc_controller_namespace = var.arc_controller_namespace arc_controller_chart_version = var.arc_controller_chart_version diff --git a/kind/dind/terraform.tfvars b/kind/dind/terraform.tfvars index 638e119..73815a2 100644 --- a/kind/dind/terraform.tfvars +++ b/kind/dind/terraform.tfvars @@ -1,15 +1,15 @@ # Cluster Config Variables cluster_name = "actions-cluster" -kubernetes_version = "v1.29.1" +kubernetes_version = "v1.30.4" kind = "Cluster" api_version = "kind.x-k8s.io/v1alpha4" #ARC Chart Variables arc_controller_namespace = "arc-systems" -arc_controller_chart_version = "0.7.0" +arc_controller_chart_version = "0.9.3" arc_runner_namespace = "arc-runners" -arc_runner_chart_version = "0.7.0" +arc_runner_chart_version = "0.9.3" arc_runner_config = [{ name = "githubConfigUrl" value = "https://github.com/" # This is a dummy repo diff --git a/kind/k8s/main.tf b/kind/k8s/main.tf index b1c38f6..d3c2991 100644 --- a/kind/k8s/main.tf +++ b/kind/k8s/main.tf @@ -14,7 +14,7 @@ module "actions_ebs_chart" { } module "actions_actions_arc_chart" { - source = "../../actions-arc-k8s-chart" + source = "../../actions-arc-chart" arc_controller_namespace = var.arc_controller_namespace arc_controller_chart_version = var.arc_controller_chart_version diff --git a/kind/k8s/terraform.tfvars b/kind/k8s/terraform.tfvars index 6846dce..8de799e 100644 --- a/kind/k8s/terraform.tfvars +++ b/kind/k8s/terraform.tfvars @@ -1,6 +1,6 @@ # Cluster Config Variables cluster_name = "actions-cluster" -kubernetes_version = "v1.29.1" +kubernetes_version = "v1.30.4" kind = "Cluster" api_version = "kind.x-k8s.io/v1alpha4" @@ -11,10 +11,10 @@ open_ebs_namespace = "openebs" #ARC Chart Variables arc_controller_namespace = "arc-systems" -arc_controller_chart_version = "0.7.0" +arc_controller_chart_version = "0.9.3" arc_runner_namespace = "arc-runners" -arc_runner_chart_version = "0.7.0" +arc_runner_chart_version = "0.9.3" arc_runner_config = [{ name = "githubConfigUrl" value = "https://github.com/" # This is a dummy repo diff --git a/minikube/dind/main.tf b/minikube/dind/main.tf index 2727c25..563b87c 100644 --- a/minikube/dind/main.tf +++ b/minikube/dind/main.tf @@ -12,7 +12,7 @@ module "action_cluster" { } module "actions_actions_arc_chart" { - source = "../../actions-arc-dind-chart" + source = "../../actions-arc-chart" arc_controller_namespace = var.arc_controller_namespace arc_controller_chart_version = var.arc_controller_chart_version diff --git a/minikube/dind/terraform.tfvars b/minikube/dind/terraform.tfvars index c9e3896..c18e49c 100644 --- a/minikube/dind/terraform.tfvars +++ b/minikube/dind/terraform.tfvars @@ -1,7 +1,7 @@ # Cluster Config Variables minikube_driver = "docker" cluster_name = "actions-cluster" -kubernetes_version = "v1.28.3" +kubernetes_version = "v1.30.0" cluster_addons = [ "ingress", "metrics-server", @@ -16,10 +16,10 @@ cluster_nodes = "3" #ARC Chart Variables arc_controller_namespace = "arc-systems" -arc_controller_chart_version = "0.7.0" +arc_controller_chart_version = "0.9.3" arc_runner_namespace = "arc-runners" -arc_runner_chart_version = "0.7.0" +arc_runner_chart_version = "0.9.3" arc_runner_config = [{ name = "githubConfigUrl" diff --git a/minikube/k8s/main.tf b/minikube/k8s/main.tf index 0534283..11d375b 100644 --- a/minikube/k8s/main.tf +++ b/minikube/k8s/main.tf @@ -18,7 +18,7 @@ module "actions_ebs_chart" { } module "actions_actions_arc_chart" { - source = "../../actions-arc-k8s-chart" + source = "../../actions-arc-chart" arc_controller_namespace = var.arc_controller_namespace arc_controller_chart_version = var.arc_controller_chart_version diff --git a/minikube/k8s/terraform.tfvars b/minikube/k8s/terraform.tfvars index e127e8d..5b7d057 100644 --- a/minikube/k8s/terraform.tfvars +++ b/minikube/k8s/terraform.tfvars @@ -1,7 +1,7 @@ # Cluster Config Variables minikube_driver = "docker" cluster_name = "actions-cluster" -kubernetes_version = "v1.28.3" +kubernetes_version = "v1.30.0" cluster_addons = [ "ingress", "metrics-server", @@ -20,10 +20,10 @@ open_ebs_namespace = "openebs" #ARC Chart Variables arc_controller_namespace = "arc-systems" -arc_controller_chart_version = "0.7.0" +arc_controller_chart_version = "0.9.3" arc_runner_namespace = "arc-runners" -arc_runner_chart_version = "0.7.0" +arc_runner_chart_version = "0.9.3" arc_runner_config = [{ name = "githubConfigUrl" value = "https://github.com/" # This is a dummy repo