Skip to content

Commit b4ca05f

Browse files
committed
feat(chart-scale-set): Add support for custom dind image and imagePullPolicy
1 parent 5402698 commit b4ca05f

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

charts/gha-runner-scale-set/templates/_helpers.tpl

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ app.kubernetes.io/instance: {{ include "gha-runner-scale-set.scale-set-name" . }
8686
{{- range $i, $val := .Values.template.spec.containers }}
8787
{{- if eq $val.name "runner" }}
8888
image: {{ $val.image }}
89+
imagePullPolicy: {{ $val.imagePullPolicy }}
8990
command: ["cp"]
9091
args: ["-r", "/home/runner/externals/.", "/home/runner/tmpDir/"]
9192
volumeMounts:
@@ -96,7 +97,11 @@ volumeMounts:
9697
{{- end }}
9798

9899
{{- define "gha-runner-scale-set.dind-container" -}}
99-
image: docker:dind
100+
{{- $root := . -}}
101+
{{- range $i, $val := .Values.template.spec.dindContainers }}
102+
{{- if eq $val.name "dind" }}
103+
image: {{ $val.image }}
104+
imagePullPolicy: {{ $val.imagePullPolicy }}
100105
args:
101106
- dockerd
102107
- --host=unix:///var/run/docker.sock
@@ -106,7 +111,7 @@ env:
106111
value: "123"
107112
securityContext:
108113
privileged: true
109-
{{- if (ge (.Capabilities.KubeVersion.Minor | int) 29) }}
114+
{{- if (ge ($root.Capabilities.KubeVersion.Minor | int) 29) }}
110115
restartPolicy: Always
111116
startupProbe:
112117
exec:
@@ -124,6 +129,8 @@ volumeMounts:
124129
mountPath: /var/run
125130
- name: dind-externals
126131
mountPath: /home/runner/externals
132+
{{- end }}
133+
{{- end }}
127134
{{- end }}
128135

129136
{{- define "gha-runner-scale-set.dind-volume" -}}

charts/gha-runner-scale-set/values.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,12 @@ template:
415415
containers:
416416
- name: runner
417417
image: ghcr.io/actions/actions-runner:latest
418+
imagePullPolicy: Always
418419
command: ["/home/runner/run.sh"]
420+
dindContainers:
421+
- name: dind
422+
image: docker:dind
423+
imagePullPolicy: Always
419424
## Optional controller service account that needs to have required Role and RoleBinding
420425
## to operate this gha-runner-scale-set installation.
421426
## The helm chart will try to find the controller deployment and its service account at installation time.

0 commit comments

Comments
 (0)