From 5e20f60cec9a81a08d5191fdde4fdae15c6cc18c Mon Sep 17 00:00:00 2001 From: Timm Drevensek <508684+timmjd@users.noreply.github.com> Date: Tue, 24 Oct 2023 12:27:29 +0200 Subject: [PATCH 1/3] add deploymentName config parameter --- charts/gha-runner-scale-set/templates/_helpers.tpl | 4 ++++ .../templates/autoscalingrunnerset.yaml | 6 +++--- charts/gha-runner-scale-set/values.yaml | 3 +++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/charts/gha-runner-scale-set/templates/_helpers.tpl b/charts/gha-runner-scale-set/templates/_helpers.tpl index 1e309ab2..b6420082 100644 --- a/charts/gha-runner-scale-set/templates/_helpers.tpl +++ b/charts/gha-runner-scale-set/templates/_helpers.tpl @@ -14,6 +14,10 @@ gha-rs {{ .Values.runnerScaleSetName | default .Release.Name }} {{- end }} +{{- define "gha-runner-scale-set.deployment-name" -}} +{{ .Values.deploymentName | default (include "gha-runner-scale-set.scale-set-name" .) }} +{{- end }} + {{/* Create a default fully qualified app name. We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). diff --git a/charts/gha-runner-scale-set/templates/autoscalingrunnerset.yaml b/charts/gha-runner-scale-set/templates/autoscalingrunnerset.yaml index 27460cc2..e8bbb448 100644 --- a/charts/gha-runner-scale-set/templates/autoscalingrunnerset.yaml +++ b/charts/gha-runner-scale-set/templates/autoscalingrunnerset.yaml @@ -1,13 +1,13 @@ apiVersion: actions.github.com/v1alpha1 kind: AutoscalingRunnerSet metadata: - {{- if or (not (include "gha-runner-scale-set.scale-set-name" .)) (gt (len (include "gha-runner-scale-set.scale-set-name" .)) 45) }} + {{- if or (not (include "gha-runner-scale-set.deployment-name" .)) (gt (len (include "gha-runner-scale-set.deployment-name" .)) 45) }} {{ fail "Name must have up to 45 characters" }} {{- end }} {{- if gt (len .Release.Namespace) 63 }} {{ fail "Namespace must have up to 63 characters" }} {{- end }} - name: {{ include "gha-runner-scale-set.scale-set-name" . }} + name: {{ include "gha-runner-scale-set.deployment-name" . }} namespace: {{ .Release.Namespace }} labels: app.kubernetes.io/component: "autoscaling-runner-set" @@ -33,7 +33,7 @@ spec: {{- with .Values.runnerGroup }} runnerGroup: {{ . }} {{- end }} - {{- with .Values.runnerScaleSetName }} + {{- with (include "gha-runner-scale-set.scale-set-name" .) }} runnerScaleSetName: {{ . }} {{- end }} diff --git a/charts/gha-runner-scale-set/values.yaml b/charts/gha-runner-scale-set/values.yaml index cedb44be..3fbb508d 100644 --- a/charts/gha-runner-scale-set/values.yaml +++ b/charts/gha-runner-scale-set/values.yaml @@ -47,6 +47,9 @@ githubConfigSecret: ## name of the runner scale set to create. Defaults to the helm release name # runnerScaleSetName: "" +## name of the runner scale set deployment in kubernetes to create. Defaults to the runnerScaleSetName +# deploymentName: "" + ## A self-signed CA certificate for communication with the GitHub server can be ## provided using a config map key selector. If `runnerMountPath` is set, for ## each runner pod ARC will: From 599d19939ef0bec31d18ffdae05a48d66b40b514 Mon Sep 17 00:00:00 2001 From: Timm Drevensek <508684+timmjd@users.noreply.github.com> Date: Tue, 24 Oct 2023 12:55:02 +0200 Subject: [PATCH 2/3] add missing renamings --- .../gha-runner-scale-set/templates/_helpers.tpl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/charts/gha-runner-scale-set/templates/_helpers.tpl b/charts/gha-runner-scale-set/templates/_helpers.tpl index b6420082..0fe56301 100644 --- a/charts/gha-runner-scale-set/templates/_helpers.tpl +++ b/charts/gha-runner-scale-set/templates/_helpers.tpl @@ -15,7 +15,7 @@ gha-rs {{- end }} {{- define "gha-runner-scale-set.deployment-name" -}} -{{ .Values.deploymentName | default (include "gha-runner-scale-set.scale-set-name" .) }} +{{ (.Values.deploymentName | default (include "gha-runner-scale-set.scale-set-name" .)) | trunc 63 | trimSuffix "-" }} {{- end }} {{/* @@ -66,24 +66,24 @@ app.kubernetes.io/instance: {{ include "gha-runner-scale-set.scale-set-name" . } {{- fail "Values.githubConfigSecret is required for setting auth with GitHub server." }} {{- end }} {{- else }} -{{- include "gha-runner-scale-set.fullname" . }}-github-secret +{{- include "gha-runner-scale-set.deployment-name" . }}-github-secret {{- end }} {{- end }} {{- define "gha-runner-scale-set.noPermissionServiceAccountName" -}} -{{- include "gha-runner-scale-set.fullname" . }}-no-permission +{{- include "gha-runner-scale-set.deployment-name" . }}-no-permission {{- end }} {{- define "gha-runner-scale-set.kubeModeRoleName" -}} -{{- include "gha-runner-scale-set.fullname" . }}-kube-mode +{{- include "gha-runner-scale-set.deployment-name" . }}-kube-mode {{- end }} {{- define "gha-runner-scale-set.kubeModeRoleBindingName" -}} -{{- include "gha-runner-scale-set.fullname" . }}-kube-mode +{{- include "gha-runner-scale-set.deployment-name" . }}-kube-mode {{- end }} {{- define "gha-runner-scale-set.kubeModeServiceAccountName" -}} -{{- include "gha-runner-scale-set.fullname" . }}-kube-mode +{{- include "gha-runner-scale-set.deployment-name" . }}-kube-mode {{- end }} {{- define "gha-runner-scale-set.dind-init-container" -}} @@ -432,11 +432,11 @@ volumeMounts: {{- end }} {{- define "gha-runner-scale-set.managerRoleName" -}} -{{- include "gha-runner-scale-set.fullname" . }}-manager +{{- include "gha-runner-scale-set.deployment-name" . }}-manager {{- end }} {{- define "gha-runner-scale-set.managerRoleBindingName" -}} -{{- include "gha-runner-scale-set.fullname" . }}-manager +{{- include "gha-runner-scale-set.deployment-name" . }}-manager {{- end }} {{- define "gha-runner-scale-set.managerServiceAccountName" -}} From 72c94a72e1129e5b3c8ba2ad7a55eb42bd965509 Mon Sep 17 00:00:00 2001 From: Timm Drevensek <508684+timmjd@users.noreply.github.com> Date: Tue, 24 Oct 2023 12:57:21 +0200 Subject: [PATCH 3/3] typo --- charts/gha-runner-scale-set/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/gha-runner-scale-set/values.yaml b/charts/gha-runner-scale-set/values.yaml index 3fbb508d..cfc46077 100644 --- a/charts/gha-runner-scale-set/values.yaml +++ b/charts/gha-runner-scale-set/values.yaml @@ -47,7 +47,7 @@ githubConfigSecret: ## name of the runner scale set to create. Defaults to the helm release name # runnerScaleSetName: "" -## name of the runner scale set deployment in kubernetes to create. Defaults to the runnerScaleSetName +## name of the autoscalingrunnersets deployment in kubernetes to create. Defaults to the runnerScaleSetName # deploymentName: "" ## A self-signed CA certificate for communication with the GitHub server can be