[JK] DinD Graceful termination - Wait for Runner
This commit is contained in:
parent
0a6208e38d
commit
cf344777a8
|
|
@ -113,6 +113,17 @@ volumeMounts:
|
||||||
mountPath: /var/run
|
mountPath: /var/run
|
||||||
- name: dind-externals
|
- name: dind-externals
|
||||||
mountPath: /home/runner/externals
|
mountPath: /home/runner/externals
|
||||||
|
lifecycle:
|
||||||
|
preStop:
|
||||||
|
exec:
|
||||||
|
command:
|
||||||
|
- /bin/sh
|
||||||
|
- -c
|
||||||
|
- >
|
||||||
|
while pgrep "Runner.Worker" > /dev/null; do
|
||||||
|
echo "Runner's Worker is still running, delaying termination...";
|
||||||
|
sleep 2;
|
||||||
|
done
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
{{- define "gha-runner-scale-set.dind-volume" -}}
|
{{- define "gha-runner-scale-set.dind-volume" -}}
|
||||||
|
|
|
||||||
|
|
@ -116,6 +116,9 @@ spec:
|
||||||
restartPolicy: Never
|
restartPolicy: Never
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- $containerMode := .Values.containerMode }}
|
{{- $containerMode := .Values.containerMode }}
|
||||||
|
{{- if eq $containerMode.type "dind" }}
|
||||||
|
shareProcessNamespace: true
|
||||||
|
{{- end }}
|
||||||
{{- if eq $containerMode.type "kubernetes" }}
|
{{- if eq $containerMode.type "kubernetes" }}
|
||||||
serviceAccountName: {{ default (include "gha-runner-scale-set.kubeModeServiceAccountName" .) .Values.template.spec.serviceAccountName }}
|
serviceAccountName: {{ default (include "gha-runner-scale-set.kubeModeServiceAccountName" .) .Values.template.spec.serviceAccountName }}
|
||||||
{{- else }}
|
{{- else }}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue