From 2f05012952eddb0bb955c2be85c154a2943fb22e Mon Sep 17 00:00:00 2001 From: Vladimir <26582191+SweetOps@users.noreply.github.com> Date: Thu, 14 Apr 2022 17:27:16 +0300 Subject: [PATCH] fix: minor fixes in github-actions-runners (#21) --- charts/github-actions-runners/Chart.yaml | 2 +- charts/github-actions-runners/templates/hpa.yaml | 2 ++ charts/github-actions-runners/templates/runnerdeployment.yaml | 4 ++++ charts/github-actions-runners/templates/serviceaccount.yaml | 2 +- charts/github-actions-runners/values.yaml | 1 + 5 files changed, 9 insertions(+), 2 deletions(-) diff --git a/charts/github-actions-runners/Chart.yaml b/charts/github-actions-runners/Chart.yaml index 91c4ff9..1da9404 100644 --- a/charts/github-actions-runners/Chart.yaml +++ b/charts/github-actions-runners/Chart.yaml @@ -2,6 +2,6 @@ apiVersion: v2 name: github-actions-runners description: A Helm chart for provisioning Github Actions runners type: application -version: 0.2.0 +version: 0.2.1 maintainers: - name: SweetOps diff --git a/charts/github-actions-runners/templates/hpa.yaml b/charts/github-actions-runners/templates/hpa.yaml index 8aa88b9..35e696e 100644 --- a/charts/github-actions-runners/templates/hpa.yaml +++ b/charts/github-actions-runners/templates/hpa.yaml @@ -9,6 +9,7 @@ {{- $maxReplicas := $autoscaling.maxReplicas | default $.Values.global.autoscaling.maxReplicas }} {{- $scaleUpTriggers := $autoscaling.scaleUpTriggers | default $.Values.global.autoscaling.scaleUpTriggers }} {{- $metrics := $autoscaling.metrics | default $.Values.global.autoscaling.metrics }} +{{- $scaleDownDelaySecondsAfterScaleOut := $autoscaling.scaleDownDelaySecondsAfterScaleOut | default $.Values.global.autoscaling.scaleDownDelaySecondsAfterScaleOut }} {{- if $autoscalingEnabled }} kind: HorizontalRunnerAutoscaler apiVersion: actions.summerwind.dev/v1alpha1 @@ -18,6 +19,7 @@ metadata: github-actions-runner: {{ .name }} {{- include "github-actions-runners.labels" $ | nindent 4 }} spec: + scaleDownDelaySecondsAfterScaleOut: {{ $scaleDownDelaySecondsAfterScaleOut }} minReplicas: {{ $minReplicas }} maxReplicas: {{ $maxReplicas }} scaleTargetRef: diff --git a/charts/github-actions-runners/templates/runnerdeployment.yaml b/charts/github-actions-runners/templates/runnerdeployment.yaml index 896563b..26e3caf 100644 --- a/charts/github-actions-runners/templates/runnerdeployment.yaml +++ b/charts/github-actions-runners/templates/runnerdeployment.yaml @@ -7,6 +7,8 @@ {{- $repository := $imageSpec.repository | default $.Values.global.image.repository }} {{- $tag := $imageSpec.tag | default $.Values.global.image.tag }} {{- $pullPolicy := $imageSpec.pullPolicy | default $.Values.global.image.pullPolicy }} +{{- $autoscaling := .autoscaling | default dict }} +{{- $autoscalingEnabled := $autoscaling.enabled | default false }} kind: RunnerDeployment apiVersion: actions.summerwind.dev/v1alpha1 metadata: @@ -15,7 +17,9 @@ metadata: github-actions-runner: {{ .name }} {{- include "github-actions-runners.labels" $ | nindent 4 }} spec: + {{- if not $autoscalingEnabled }} replicas: {{ .replicaCount | default $.Values.global.replicaCount }} + {{- end }} template: metadata: {{- with (default $.Values.global.podAnnotations .podAnnotations) }} diff --git a/charts/github-actions-runners/templates/serviceaccount.yaml b/charts/github-actions-runners/templates/serviceaccount.yaml index 4bbda6f..392d165 100644 --- a/charts/github-actions-runners/templates/serviceaccount.yaml +++ b/charts/github-actions-runners/templates/serviceaccount.yaml @@ -1,5 +1,4 @@ {{- range .Values.runnerDeployments }} ---- {{- $enabled := printf "%t" .enabled }} {{- if regexMatch "nil" $enabled }}{{- $enabled = "true" }}{{- end }} {{- if (eq $enabled "true") }} @@ -7,6 +6,7 @@ {{- $create := $serviceAccount.create | default $.Values.global.serviceAccount.create }} {{- $annotations := $serviceAccount.annotations | default $.Values.global.serviceAccount.annotations }} {{- if $create -}} +--- apiVersion: v1 kind: ServiceAccount metadata: diff --git a/charts/github-actions-runners/values.yaml b/charts/github-actions-runners/values.yaml index 8b07f5e..63b07ad 100644 --- a/charts/github-actions-runners/values.yaml +++ b/charts/github-actions-runners/values.yaml @@ -45,6 +45,7 @@ global: maxReplicas: 3 metrics: [] scaleUpTriggers: [] + scaleDownDelaySecondsAfterScaleOut: 300 runnerDeployments: