Skip to content

Commit 6cc3cb4

Browse files
authored
Upstream and replace github-actions-runner with eks/actions-runner-controller (cloudposse/terraform-aws-components#485)
* replaced github-actions-runner with eks/actions-runner-controller * corrected variable description * moved github-actions-runner to deprecrated, rather than deleted * added README reference * PR comments * added documentation for github tokens * corrected webhook_enabled
0 parents  commit 6cc3cb4

File tree

14 files changed

+1306
-0
lines changed

14 files changed

+1306
-0
lines changed

src/README.md

Lines changed: 207 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
apiVersion: v2
2+
name: actions-runner
3+
description: A Helm chart for Kubernetes
4+
5+
# A chart can be either an 'application' or a 'library' chart.
6+
#
7+
# Application charts are a collection of templates that can be packaged into versioned archives
8+
# to be deployed.
9+
#
10+
# Library charts provide useful utilities or functions for the chart developer. They're included as
11+
# a dependency of application charts to inject those utilities and functions into the rendering
12+
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
13+
type: application
14+
15+
# This is the chart version. This version number should be incremented each time you make changes
16+
# to the chart and its templates, including the app version.
17+
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18+
version: 0.1.0
19+
20+
# This chart only deploys Resources for actions-runner-controller, so app version does not really apply.
21+
# We use Resource API version instead.
22+
appVersion: "v1alpha1"
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
apiVersion: actions.summerwind.dev/v1alpha1
2+
kind: HorizontalRunnerAutoscaler
3+
metadata:
4+
name: {{ .Values.release_name }}
5+
spec:
6+
# Runners in the targeted RunnerDeployment won't be scaled down
7+
# for 5 minutes instead of the default 10 minutes now
8+
scaleDownDelaySecondsAfterScaleOut: {{ .Values.scale_down_delay_seconds }}
9+
scaleTargetRef:
10+
name: {{ .Values.release_name }}
11+
minReplicas: {{ .Values.min_replicas }}
12+
maxReplicas: {{ .Values.max_replicas }}
13+
{{- if .Values.pull_driven_scaling_enabled }}
14+
metrics:
15+
- type: PercentageRunnersBusy
16+
scaleUpThreshold: {{ .Values.scale_up_threshold | quote }}
17+
scaleDownThreshold: {{ .Values.scale_down_threshold | quote }}
18+
{{- if .Values.scale_up_factor }}
19+
scaleUpFactor: {{ .Values.scale_up_factor | quote }}
20+
{{- else }}
21+
scaleUpAdjustment: {{ .Values.scale_up_adjustment | quote }}
22+
{{- end }}
23+
{{- if .Values.scale_down_factor }}
24+
scaleDownFactor: {{ .Values.scale_down_factor | quote }}
25+
{{- else }}
26+
scaleUpAdjustment: {{ .Values.scale_down_adjustment | quote }}
27+
{{- end }}
28+
{{- end }}
29+
{{- if .Values.webhook_driven_scaling_enabled }}
30+
scaleUpTriggers:
31+
- githubEvent:
32+
workflowJob: {}
33+
amount: 1
34+
duration: "{{ .Values.scale_down_delay_seconds }}s"
35+
{{- end }}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
apiVersion: actions.summerwind.dev/v1alpha1
2+
kind: RunnerDeployment
3+
metadata:
4+
name: {{ .Values.release_name }}
5+
spec:
6+
# Do not use `replicas` with HorizontalRunnerAutoscaler
7+
# See https://github.com/actions-runner-controller/actions-runner-controller/issues/206#issuecomment-748601907
8+
# replicas: 1
9+
template:
10+
spec:
11+
# You could reserve nodes for runners by labeling and tainting nodes with
12+
# node-role.kubernetes.io/actions-runner
13+
# and then adding the following to this RunnerDeployment
14+
#
15+
# nodeSelector:
16+
# node-role.kubernetes.io/actions-runner: ""
17+
#
18+
# tolerations:
19+
# - effect: NoSchedule
20+
# key: node-role.kubernetes.io/actions-runner
21+
# operator: Exists
22+
23+
{{ if eq .Values.type "organization" }}
24+
organization: {{ .Values.scope }}
25+
{{ end }}
26+
{{ if eq .Values.type "repository" }}
27+
repository: {{ .Values.scope }}
28+
{{ end }}
29+
# You can use labels to create subsets of runners.
30+
# See https://github.com/summerwind/actions-runner-controller#runner-labels
31+
# and https://docs.github.com/en/free-pro-team@latest/actions/hosting-your-own-runners/using-self-hosted-runners-in-a-workflow
32+
labels:
33+
# It appears that the webhook autoscaler requires the runner deployment
34+
# to explicitly include the "self-hosted" label in order to match the
35+
# workflow_job to it.
36+
- self-hosted
37+
{{- range .Values.labels }}
38+
- {{ . | quote }}
39+
{{- end }}
40+
# dockerdWithinRunnerContainer = false means access to a Docker daemon is provided by a sidecar container.
41+
dockerdWithinRunnerContainer: {{ .Values.dind_enabled }}
42+
image: {{ .Values.image | quote }}
43+
imagePullPolicy: IfNotPresent
44+
serviceAccountName: {{ .Values.service_account_name }}
45+
resources:
46+
{{- toYaml .Values.resources | nindent 8 }}
47+

0 commit comments

Comments
 (0)