diff --git a/charts/gha-runner-scale-set/templates/_helpers.tpl b/charts/gha-runner-scale-set/templates/_helpers.tpl index cd827afd..dad529a4 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" .)) | trunc 63 | trimSuffix "-" }} +{{- 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). @@ -62,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" -}} @@ -433,11 +437,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" -}} diff --git a/charts/gha-runner-scale-set/templates/autoscalingrunnerset.yaml b/charts/gha-runner-scale-set/templates/autoscalingrunnerset.yaml index c5ad2e38..cbdf66f8 100644 --- a/charts/gha-runner-scale-set/templates/autoscalingrunnerset.yaml +++ b/charts/gha-runner-scale-set/templates/autoscalingrunnerset.yaml @@ -2,13 +2,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: {{- with .Values.labels }} @@ -51,7 +51,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 7c32b436..72b68568 100644 --- a/charts/gha-runner-scale-set/values.yaml +++ b/charts/gha-runner-scale-set/values.yaml @@ -63,6 +63,9 @@ githubConfigSecret: ## name of the runner scale set to create. Defaults to the helm release name # 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 ## provided using a config map key selector. If `runnerMountPath` is set, for ## each runner pod ARC will: