Go to file
Nikola Jokic aa6dab5a9a
Changes to folder structure to allow multigroups and changed go mod name (#2105)
* Changed folder structure to allow multi group registration

* included actions.github.com directory for resources and controllers

* updated go module to actions/actions-runner-controller

* publish arc packages under actions-runner-controller

* Update charts/actions-runner-controller/docs/UPGRADING.md

Co-authored-by: Yusuke Kuoka <ykuoka@gmail.com>
2022-12-28 09:38:34 +09:00
.github Changes to folder structure to allow multigroups and changed go mod name (#2105) 2022-12-28 09:38:34 +09:00
acceptance Changes to folder structure to allow multigroups and changed go mod name (#2105) 2022-12-28 09:38:34 +09:00
adrs Revamp the contribution guide (#1917) 2022-10-21 22:56:42 +09:00
apis Changes to folder structure to allow multigroups and changed go mod name (#2105) 2022-12-28 09:38:34 +09:00
build Print Version Number on startup (#1659) 2022-08-23 13:40:16 +09:00
charts Changes to folder structure to allow multigroups and changed go mod name (#2105) 2022-12-28 09:38:34 +09:00
cmd Changes to folder structure to allow multigroups and changed go mod name (#2105) 2022-12-28 09:38:34 +09:00
config Changes to folder structure to allow multigroups and changed go mod name (#2105) 2022-12-28 09:38:34 +09:00
contrib Changes to folder structure to allow multigroups and changed go mod name (#2105) 2022-12-28 09:38:34 +09:00
controllers Changes to folder structure to allow multigroups and changed go mod name (#2105) 2022-12-28 09:38:34 +09:00
docs Changes to folder structure to allow multigroups and changed go mod name (#2105) 2022-12-28 09:38:34 +09:00
github Changes to folder structure to allow multigroups and changed go mod name (#2105) 2022-12-28 09:38:34 +09:00
hack Changes to folder structure to allow multigroups and changed go mod name (#2105) 2022-12-28 09:38:34 +09:00
hash feat: EKS IAM Roles for Service Accounts for Runner Pods (#226) 2020-12-08 17:56:06 +09:00
logging 1770 update log format and add additional fields to webhook server logs (#1771) 2022-11-04 10:46:58 +09:00
pkg Changes to folder structure to allow multigroups and changed go mod name (#2105) 2022-12-28 09:38:34 +09:00
runner Changes to folder structure to allow multigroups and changed go mod name (#2105) 2022-12-28 09:38:34 +09:00
simulator Changes to folder structure to allow multigroups and changed go mod name (#2105) 2022-12-28 09:38:34 +09:00
test Changes to folder structure to allow multigroups and changed go mod name (#2105) 2022-12-28 09:38:34 +09:00
testing Changes to folder structure to allow multigroups and changed go mod name (#2105) 2022-12-28 09:38:34 +09:00
.dockerignore dockerfile,e2e: Use buildx and cache mounts for faster rebuilds in E2E 2022-03-02 19:03:20 +09:00
.gitignore e2e: Install and run workflow and verify the result (#661) 2021-06-28 08:30:32 +09:00
.golangci.yaml Changes to folder structure to allow multigroups and changed go mod name (#2105) 2022-12-28 09:38:34 +09:00
CODEOWNERS chore: add toast-gear to the list of maintainers (#2095) 2022-12-15 11:00:08 +01:00
CODE_OF_CONDUCT.md Add code of conduct 2022-12-13 11:38:01 +00:00
CONTRIBUTING.md Changes to folder structure to allow multigroups and changed go mod name (#2105) 2022-12-28 09:38:34 +09:00
Dockerfile Changes to folder structure to allow multigroups and changed go mod name (#2105) 2022-12-28 09:38:34 +09:00
LICENSE Add LICENSE 2020-01-30 20:12:12 +09:00
Makefile Changes to folder structure to allow multigroups and changed go mod name (#2105) 2022-12-28 09:38:34 +09:00
PROJECT Changes to folder structure to allow multigroups and changed go mod name (#2105) 2022-12-28 09:38:34 +09:00
README.md Changes to folder structure to allow multigroups and changed go mod name (#2105) 2022-12-28 09:38:34 +09:00
SECURITY.md Add security guidelines and policy 2022-12-13 11:39:39 +00:00
TROUBLESHOOTING.md Changes to folder structure to allow multigroups and changed go mod name (#2105) 2022-12-28 09:38:34 +09:00
go.mod Changes to folder structure to allow multigroups and changed go mod name (#2105) 2022-12-28 09:38:34 +09:00
go.sum fix(deps): update kubernetes packages to v0.25.5 (#2083) 2022-12-09 07:03:21 +09:00
main.go Changes to folder structure to allow multigroups and changed go mod name (#2105) 2022-12-28 09:38:34 +09:00

README.md

Actions Runner Controller (ARC)

CII Best Practices awesome-runners Artifact Hub

GitHub Actions automates the deployment of code to different environments, including production. The environments contain the GitHub Runner software which executes the automation. GitHub Runner can be run in GitHub-hosted cloud or self-hosted environments. Self-hosted environments offer more control of hardware, operating system, and software tools. They can be run on physical machines, virtual machines, or in a container. Containerized environments are lightweight, loosely coupled, highly efficient and can be managed centrally. However, they are not straightforward to use.

Actions Runner Controller (ARC) makes it simpler to run self hosted environments on Kubernetes(K8s) cluster.

With ARC you can :

  • Deploy self hosted runners on Kubernetes cluster with a simple set of commands.
  • Auto scale runners based on demand.
  • Setup across GitHub editions including GitHub Enterprise editions and GitHub Enterprise Cloud.

Overview

For an overview of ARC, please refer to "ARC Overview."

Getting Started

ARC can be setup with just a few steps.

In this section we will setup prerequisites, deploy ARC into a K8s cluster, and then run GitHub Action workflows on that cluster.

Prerequisites

Create a K8s cluster, if not available. If you don't have a K8s cluster, you can install a local environment using minikube. For more information, see "Installing minikube."

1 Install cert-manager in your cluster. For more information, see "cert-manager."

kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.8.2/cert-manager.yaml

*note:- This command uses v1.8.2. Please replace with a later version, if available.

You may also install cert-manager using Helm. For instructions, see "Installing with Helm."

2 Next, Generate a Personal Access Token (PAT) for ARC to authenticate with GitHub.

  • Login to your GitHub account and Navigate to "Create new Token."
  • Select repo.
  • Click Generate Token and then copy the token locally ( well need it later).

Deploy and Configure ARC

1 Deploy and configure ARC on your K8s cluster. You may use Helm or Kubectl.

Helm deployment
Add repository
helm repo add actions-runner-controller https://actions-runner-controller.github.io/actions-runner-controller
Install Helm chart
helm upgrade --install --namespace actions-runner-system --create-namespace\
  --set=authSecret.create=true\
  --set=authSecret.github_token="REPLACE_YOUR_TOKEN_HERE"\
  --wait actions-runner-controller actions/actions-runner-controller

*note:- Replace REPLACE_YOUR_TOKEN_HERE with your PAT that was generated previously.

Kubectl deployment
Deploy ARC
kubectl apply -f \
https://github.com/actions/actions-runner-controller/\
releases/download/v0.22.0/actions-runner-controller.yaml

*note:- Replace "v0.22.0" with the version you wish to deploy

Configure Personal Access Token
kubectl create secret generic controller-manager \
    -n actions-runner-system \
    --from-literal=github_token=REPLACE_YOUR_TOKEN_HERE

*note:- Replace REPLACE_YOUR_TOKEN_HERE with your PAT that was generated previously.

2 Create the GitHub self hosted runners and configure to run against your repository.

Create a runnerdeployment.yaml file and copy the following YAML contents into it:

apiVersion: actions.summerwind.dev/v1alpha1
kind: RunnerDeployment
metadata:
  name: example-runnerdeploy
spec:
  replicas: 1
  template:
    spec:
      repository: mumoshu/actions-runner-controller-ci

*note:- Replace "mumoshu/actions-runner-controller-ci" with your repository name.

Apply this file to your K8s cluster.

kubectl apply -f runnerdeployment.yaml

🎉 We are done - now we should have self hosted runners running in K8s configured to your repository. 🎉

Next - lets verify our setup and execute some workflows.

Verify and Execute Workflows

1 Verify that your setup is successful:


$ kubectl get runners
NAME                             REPOSITORY                             STATUS
example-runnerdeploy2475h595fr   mumoshu/actions-runner-controller-ci   Running

$ kubectl get pods
NAME                           READY   STATUS    RESTARTS   AGE
example-runnerdeploy2475ht2qbr 2/2     Running   0          1m

Also, this runner has been registered directly to the specified repository, you can see it in repository settings. For more information, see "Checking the status of a self-hosted runner - GitHub Docs."

2 You are ready to execute workflows against this self-hosted runner. For more information, see "Using self-hosted runners in a workflow - GitHub Docs."

There is also a quick start guide to get started on Actions, For more information, please refer to "Quick start Guide to GitHub Actions."

Learn more

For more detailed documentation, please refer to "Detailed Documentation."

Contributing

We welcome contributions from the community. For more details on contributing to the project (including requirements), please refer to "Getting Started with Contributing."

Troubleshooting

We are very happy to help you with any issues you have. Please refer to the "Troubleshooting" section for common issues.