diff --git a/README.md b/README.md index b0a4d0d3..15822392 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,9 @@ Depending on whether the GitHub application will operate at a repository or orga * Organization level * Self Hosted Runners - Read/Write -Once the GitHub application has been created, obtain the integration ID and download the private key. +Once the GitHub application has been created, go to the "General" tab of the github app. Under the "About" section, note down the `App ID`. +Scroll down to the `Private keys` section and generate and download a private key. +Install the app from the "install App" section of the github app. 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. @@ -45,14 +47,6 @@ Create a secret called `github-runner-app` by executing the following command in kubectl create secret generic github-runner-app --from-literal=GITHUB_APP_INTEGRATION_ID= --from-file=GITHUB_APP_PRIVATE_KEY= ``` -Finally define the following on the operator deployment: - -```shell script -envFrom: -- secretRef: - name: github-runner-app -```` - 2. Using [Personal Access Tokens (PAT)](https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/creating-a-personal-access-token) Create a Personal Access token with rights at a repository or organization level. @@ -113,7 +107,7 @@ Use the following steps to create a namespace and install the operator into the ```shell script 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 +helm install github-actions-runner-operator evryfs-oss/github-actions-runner-operator --namespace github-actions-runner-operator --set githubapp.existingSecret=github-runner-app --set githubapp.enabled=true ``` ### Manual @@ -127,6 +121,23 @@ _Note:_ The [Kustomize](https://kustomize.io/) tool is required make install ``` +Update the values.yaml file depending on how you deploy the secret for the github app: + +#### Kubernetes Secret +```shell script +githubapp: + enabled: true + existingSecret: "github-runner-app" +```` + +#### Manually passing values +```shell script +githubapp: + enabled: true + integrationId: "" + privateKey: +```` + 2. Deploy the Operator ```shell script diff --git a/config/samples/garo_v1alpha1_githubactionrunner.yaml b/config/samples/garo_v1alpha1_githubactionrunner.yaml index b2a47817..08e4048e 100644 --- a/config/samples/garo_v1alpha1_githubactionrunner.yaml +++ b/config/samples/garo_v1alpha1_githubactionrunner.yaml @@ -9,11 +9,12 @@ spec: # max number of pods, required maxRunners: 6 # the github org, required - organization: yourOrg + organization: # How often it will reconcile, optional, default 1m reconciliationPeriod: 1m # if runner for repo, optional # repository: "theRepoName" + # tokenRef not required if using helm chart with secret deployed. tokenRef: key: GH_TOKEN name: actions-runner @@ -49,10 +50,15 @@ spec: - name: DOCKER_CERT_PATH value: /certs/client - name: GH_ORG - value: yourOrg + value: # if runner for repo: # - name: GH_REPO # value: theRepoName + # if using maven, optional: + # - mountPath: /home/runner/.m2 + # name: mvn-repo + # - mountPath: /home/runner/.m2/settings.xml + # name: settings-xml envFrom: - secretRef: name: runner-pool-regtoken @@ -69,10 +75,11 @@ spec: name: runner-diag - mountPath: /home/runner/_work name: runner-work - - mountPath: /home/runner/.m2 - name: mvn-repo - - mountPath: /home/runner/.m2/settings.xml - name: settings-xml + # if using maven, optional: + # - mountPath: /home/runner/.m2 + # name: mvn-repo + # - mountPath: /home/runner/.m2/settings.xml + # name: settings-xml - name: docker env: - name: DOCKER_TLS_CERTDIR @@ -106,13 +113,15 @@ spec: name: runner-work - emptyDir: {} name: runner-diag - - emptyDir: {} - name: mvn-repo + # if using maven, optional: + # - emptyDir: {} + # name: mvn-repo - emptyDir: {} name: docker-storage - emptyDir: {} name: docker-certs - - configMap: - defaultMode: 420 - name: settings-xml - name: settings-xml + # if using maven, optional: + # - configMap: + # defaultMode: 420 + # name: settings-xml + # name: settings-xml