From 03f1bce3ebcbd38af2477ca923f88f78c3f91400 Mon Sep 17 00:00:00 2001 From: mpw Date: Sun, 30 Jul 2023 16:39:21 -0300 Subject: [PATCH 1/2] deploy 1 runner per node unless all busy --- charts/github-runners/templates/runner.yaml | 20 +++++++++++++++++++- charts/github-runners/values.yaml | 2 ++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/charts/github-runners/templates/runner.yaml b/charts/github-runners/templates/runner.yaml index 0bf2adf..af1c36e 100644 --- a/charts/github-runners/templates/runner.yaml +++ b/charts/github-runners/templates/runner.yaml @@ -8,9 +8,14 @@ kind: RunnerDeployment metadata: name: {{ $runner.name }}-{{ . }} namespace: actions-runner-system + labels: + arch: {{ . }} + organization: {{ $organizationName }} spec: + replicas: {{ $runner.replicas.min }} template: spec: + repository: {{ $organizationName }}/{{ $runner.repository }} labels: - {{ . }} {{- if eq . "amd64" }} @@ -19,11 +24,24 @@ spec: nodeSelector: kubernetes.io/arch: {{ . }} tolerations: + {{- if $runner.extraTolerations }} + {{ toYaml $runner.extraTolerations | indent 8 }} + {{- end }} - key: "kubernetes.io/arch" operator: "Equal" value: {{ . }} effect: "NoSchedule" - repository: {{ $organizationName }}/{{ $runner.repository }} + topologySpreadConstraints: + {{- if $runner.extraConstraints }} + {{ toYaml $runner.extraConstraints | indent 8 }} + {{- end }} + - maxSkew: 1 + topologyKey: kubernetes.io/hostname + whenUnsatisfiable: ScheduleAnyway + labelSelector: + matchLabels: + arch: {{ . }} + organization: {{ $organizationName }} --- apiVersion: actions.summerwind.dev/v1alpha1 kind: HorizontalRunnerAutoscaler diff --git a/charts/github-runners/values.yaml b/charts/github-runners/values.yaml index 21906cd..e176968 100644 --- a/charts/github-runners/values.yaml +++ b/charts/github-runners/values.yaml @@ -5,6 +5,8 @@ runners: [] # architectures: # - arm64 # - amd64 +# extraTolerations: [] +# extraConstraints: [] # replicas: # min: 0 # max: 5 From 8a3ef6a15da535299fb12b35a791259d6edf0149 Mon Sep 17 00:00:00 2001 From: mpw Date: Sun, 30 Jul 2023 17:41:04 -0300 Subject: [PATCH 2/2] add extraSpecs --- charts/github-runners/Chart.yaml | 4 ++-- charts/github-runners/templates/runner.yaml | 5 +++++ charts/github-runners/values.yaml | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/charts/github-runners/Chart.yaml b/charts/github-runners/Chart.yaml index 62150fe..be59782 100644 --- a/charts/github-runners/Chart.yaml +++ b/charts/github-runners/Chart.yaml @@ -19,12 +19,12 @@ type: application # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.1 +version: 0.1.2 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: 0.1.1 +appVersion: 0.1.2 sources: - https://github.com/holaplex/helm-charts diff --git a/charts/github-runners/templates/runner.yaml b/charts/github-runners/templates/runner.yaml index af1c36e..6bfc5ac 100644 --- a/charts/github-runners/templates/runner.yaml +++ b/charts/github-runners/templates/runner.yaml @@ -16,6 +16,11 @@ spec: template: spec: repository: {{ $organizationName }}/{{ $runner.repository }} + {{- with $runner.extraSpecs }} + {{- range $key, $value := . }} + {{ $key }}: {{ $value }} + {{- end }} + {{- end }} labels: - {{ . }} {{- if eq . "amd64" }} diff --git a/charts/github-runners/values.yaml b/charts/github-runners/values.yaml index e176968..44e001d 100644 --- a/charts/github-runners/values.yaml +++ b/charts/github-runners/values.yaml @@ -7,6 +7,7 @@ runners: [] # - amd64 # extraTolerations: [] # extraConstraints: [] +# extraSpecs: [] # replicas: # min: 0 # max: 5