engaging-finches / hello-k8s

1 stars 0 forks source link

Build and Test Go Binary

Verify Lint and Format

Verify Pre Commit Standards

CodeQL

Release

hello-k8s

Description

MVP: CustomResourceDefinition (CRD), WebHooks, and associated controller to create a Deployment for Pods to run GitHub Actions self-hosted runners.

The goal of this project is to allow users to easily manage self-hosted GitHub Actions runners in Kubernetes.

Running Locally

(Clone repo)

Create a cluster

kind create cluster -n ghrunner

Install cert-manager

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

(Cert Manger might take around 5 mins to start up on cluster)

Install CRD and controller in cluster

kubectl apply -f dist/install.yaml

(This might take around 5 mins)

Verify controller is running

k get pods -n ghrunner-system

Apply sample CR manifest

k apply -f config/samples/ghrunner_v1_ghrunner.yaml

You should now be able to apply manifests for GhRunner resources.



Developer Guide

(Clone repo)

Create a cluster for managing your API and resources

kind create cluster -n ghrunner

Install cert-manager in cluster

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

Generate manifests for CRD and sample resource

make manifests

Install CRD in cluster

make install (verify that crd has been installed with k get crds -- should see ghrunners... in output)

Create a Docker image for controller and use this image to install the controller in your cluster

make docker-build docker-push IMG=imagename

Activate controller in cluster

make deploy IMG=imagename

Create a resource from CRD

kubectl apply -f config/samples/ghrunner_v1_ghrunner.yaml

How to apply changes to the controller



Configure commit hooks

Generate PAT for Husky commit-msg PAT requires read access to issues in the repo that you're using. Save PAT to a variable called GITHUB_TOKEN and store this in a .env file in the root directory of your repo.

Install packages from package.json npm install