All Projects → evryfs → Github Actions Runner Operator

evryfs / Github Actions Runner Operator

Licence: apache-2.0
K8S operator for scheduling github actions runner pods

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Github Actions Runner Operator

Mbt
The most flexible build tool for monorepo
Stars: ✭ 184 (+15.72%)
Mutual labels:  automation, ci
Blt
Acquia's toolset for automating Drupal 8 and 9 development, testing, and deployment.
Stars: ✭ 412 (+159.12%)
Mutual labels:  automation, ci
Pipeline
Node-based automation server
Stars: ✭ 212 (+33.33%)
Mutual labels:  automation, ci
Pypyr
pypyr task-runner cli & api for automation pipelines. Automate anything by combining commands, different scripts in different languages & applications into one pipeline process.
Stars: ✭ 173 (+8.81%)
Mutual labels:  automation, ci
Kube Score
Kubernetes object analysis with recommendations for improved reliability and security
Stars: ✭ 1,128 (+609.43%)
Mutual labels:  automation, ci
Rocket
Automated software delivery as fast and easy as possible 🚀
Stars: ✭ 217 (+36.48%)
Mutual labels:  automation, ci
Screenshotsnanny
Android library helps take screenshots for publishing on Google Play Store.
Stars: ✭ 237 (+49.06%)
Mutual labels:  automation, ci
Danger
🚫 Stop saying "you forgot to …" in code review (in Ruby)
Stars: ✭ 4,691 (+2850.31%)
Mutual labels:  automation, ci
Webhook
webhook is a lightweight incoming webhook server to run shell commands
Stars: ✭ 7,201 (+4428.93%)
Mutual labels:  automation, ci
Shipjs
Take control of what is going to be your next release.
Stars: ✭ 668 (+320.13%)
Mutual labels:  automation, ci
Ci Matters
Integration (comparison) of different continuous integration services on Android project
Stars: ✭ 119 (-25.16%)
Mutual labels:  automation, ci
Pipelines
Build pipelines for automation, deployment, testing...
Stars: ✭ 105 (-33.96%)
Mutual labels:  automation, ci
Dockertest
Write better integration tests! Dockertest helps you boot up ephermal docker images for your Go tests with minimal work.
Stars: ✭ 2,254 (+1317.61%)
Mutual labels:  automation, ci
Smarthome Homeassistant Config
🏠 My Home Assistant configuration. This repo will be archived 🗄️ in the future
Stars: ✭ 152 (-4.4%)
Mutual labels:  automation
Actions Cli
Monitor your GitHub Actions in real time from the command line
Stars: ✭ 156 (-1.89%)
Mutual labels:  ci
Argocd Operator
A Kubernetes operator for managing Argo CD clusters.
Stars: ✭ 151 (-5.03%)
Mutual labels:  kubernetes-operator
Qaf
Quality Automation Framework for web, mobileweb, mobile native and rest web-service using Selenium, webdrier, TestNG and Java Jersey
Stars: ✭ 150 (-5.66%)
Mutual labels:  automation
Act
Run your GitHub Actions locally 🚀
Stars: ✭ 19,915 (+12425.16%)
Mutual labels:  ci
Proctoring Ai
Creating a software for automatic monitoring in online proctoring
Stars: ✭ 155 (-2.52%)
Mutual labels:  automation
Homebridge Wol
A Wake on Lan plugin for Homebridge
Stars: ✭ 150 (-5.66%)
Mutual labels:  automation

awesome-runners GitHub go.mod Go version Codacy Badge Go Report Card build codecov GitHub release (latest SemVer) Stargazers over time

github-actions-runner-operator

K8s operator for scheduling GitHub Actions runner pods. self-hosted-runners are a way to host your own runners and customize the environment used to run jobs in your GitHub Actions workflows.

This operator helps you scale and schedule runners on-demand in a declarative way.

Configuration

Authentication modes

The operator communicates with GitHub in order to determine available jobs and execute workflow on runners. Authentication to GitHub is available using the following modes:

  1. As a GitHub app.

This is the preferred mode as it provides enhanced security and increased API quota, and avoids exposure of tokens to runner pods.

Follow the guide for creating GitHub applications. There is no need to define a callback url or webhook secret as they are not used by this integration.

Depending on whether the GitHub application will operate at a repository or organization level, the following permissions must be set:

  • Repository level
    • Actions - Read/Write
    • Administration - Read/Write
  • Organization level
    • Self Hosted Runners - Read/Write

Once the GitHub application has been created, obtain the integration ID and download the private key.

A Github application can only be used by injecting environment variables into the Operator deployment. It is recommended that credentials be stored as Kubernetes secrets and then injected into the operator deployment.

Create a secret called github-runner-app by executing the following command in the namespace containing the operator:

kubectl create secret generic github-runner-app --from-literal=GITHUB_APP_INTEGRATION_ID=<app_id> --from-file=GITHUB_APP_PRIVATE_KEY=<private_key>

Finally define the following on the operator deployment:

envFrom:
- secretRef:
    name: github-runner-app
  1. Using Personal Access Tokens (PAT)

Create a Personal Access token with rights at a repository or organization level.

This PAT can be defined at the operator level or within the custom resource (A PAT defined at the CR level will take precedence)

To make use of a PAT that is declared at a CR level, first create a secret called actions-runner

kubectl create secret generic actions-runner --from-literal=GH_TOKEN=<token>

Define the tokenRef field on the GithubActionRunner custom resource as shown below:

apiVersion: garo.tietoevry.com/v1alpha1
kind: GithubActionRunner
metadata:
  name: runner-pool
spec:
  tokenRef:
    key: GH_TOKEN
    name: actions-runner

Runner Scope

Runners can be registered either against an individual repository or at an organizational level. The following fields are available on the GithubActionRunner custom resource to specify the repository and/or organization to monitor actions:

  • organization - GitHub user or Organization
  • repository - (Optional) GitHub repository
apiVersion: garo.tietoevry.com/v1alpha1
kind: GithubActionRunner
metadata:
  name: runner-pool
spec:
  # the github org, required
  organization: yourOrg
  # the githb repository
  repository: myrepo

Runner Selection

Arguably the most important field of the GithubActionRunner custom resource is the podTemplateSpec field as it allow you to define the runner that will be managed by the operator. You have the flexibility to define all of the properties that will be needed by the runner including the image, resources and environment variables. During normal operation, the operator will create a token that can be used in your runner to communicate with GitHub. This token is created in a secret called <CR_NAME>-regtoken in the RUNNER_TOKEN key. You should inject this secret into your runner using an environment variable or volume mount.

Installation Methods

The following options are available to install the operator:

Helm Chart

A Helm chart is available from this Helm repository.

Use the following steps to create a namespace and install the operator into the namespace using a Helm chart

helm repo add evryfs-oss https://evryfs.github.io/helm-charts/
kubectl create namespace github-actions-runner-operator
helm install github-actions-runner-operator evryfs-oss/github-actions-runner-operator --namespace github-actions-runner-operator

Manual

Execute the following commands to deploy the operator using manifests available within this repository.

Note: The Kustomize tool is required

  1. Install the CRD's
make install
  1. Deploy the Operator
make deploy

OperatorHub

Coming Soon

Examples

A sample of the GithubActionRunner custom resource is found here

development

Operator is based on Operator SDK / Kube builder and written in Go.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].