Skip to content

Commit 400f7de

Browse files
authored
feat: Update prepuller
1 parent d775927 commit 400f7de

File tree

4 files changed

+50
-5
lines changed

4 files changed

+50
-5
lines changed

jupyterhub/templates/image-puller/_helpers-daemonset.tpl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,10 @@ spec:
7070
{{- include "jupyterhub.userNodeAffinityRequired" . | nindent 14 }}
7171
{{- end }}
7272
terminationGracePeriodSeconds: 0
73-
{{- with include "jupyterhub.hook-image-awaiter-serviceaccount.fullname" . }}
74-
serviceAccountName: {{ . }}
73+
{{- if .hook }}
74+
serviceAccountName: "hook-image-puller-serviceaccount"
75+
{{- else }}
76+
serviceAccountName: "continuous-image-puller-serviceaccount"
7577
{{- end }}
7678
automountServiceAccountToken: false
7779
{{- with include "jupyterhub.imagePullSecrets" (dict "root" . "image" .Values.singleuser.image) }}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{{- /*
2+
ServiceAccount for the continuous hook's
3+
*/}}
4+
{{- if .Values.prePuller.hook.serviceAccount.create -}}
5+
{{- if .Values.prePuller.continuous.enabled -}}
6+
apiVersion: v1
7+
kind: ServiceAccount
8+
metadata:
9+
name: "continuous-image-puller-serviceaccount"
10+
labels:
11+
{{- include "jupyterhub.labels" . | nindent 4 }}
12+
hub.jupyter.org/deletable: "true"
13+
annotations:
14+
"helm.sh/hook": pre-install,pre-upgrade
15+
"helm.sh/hook-weight": "0"
16+
{{- with .Values.prePuller.hook.serviceAccount.annotations }}
17+
{{- . | toYaml | nindent 4 }}
18+
{{- end }}
19+
{{- end }}
20+
{{- end }}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{{- /*
2+
ServiceAccount for the pre-puller hook's
3+
*/}}
4+
{{- if .Values.prePuller.hook.serviceAccount.create -}}
5+
{{- if (include "jupyterhub.imagePuller.daemonset.hook.install" .) -}}
6+
apiVersion: v1
7+
kind: ServiceAccount
8+
metadata:
9+
name: "hook-image-puller-serviceaccount"
10+
labels:
11+
{{- include "jupyterhub.labels" . | nindent 4 }}
12+
hub.jupyter.org/deletable: "true"
13+
annotations:
14+
"helm.sh/hook": pre-install,pre-upgrade
15+
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
16+
"helm.sh/hook-weight": "0"
17+
{{- with .Values.prePuller.hook.serviceAccount.annotations }}
18+
{{- . | toYaml | nindent 4 }}
19+
{{- end }}
20+
{{- end }}
21+
{{- end }}

jupyterhub/templates/image-puller/serviceaccount.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
{{- /*
2-
Service Account for the pre-puller hook
2+
ServiceAccount for the pre-puller hook's image-awaiter-job
33
*/}}
44
{{- if .Values.prePuller.hook.serviceAccount.create -}}
5-
{{- if or (include "jupyterhub.imagePuller.daemonset.hook.install" .) .Values.prePuller.continuous.enabled -}}
5+
{{- if (include "jupyterhub.imagePuller.daemonset.hook.install" .) -}}
66
apiVersion: v1
77
kind: ServiceAccount
88
metadata:
99
name: {{ include "jupyterhub.hook-image-awaiter-serviceaccount.fullname" . }}
1010
labels:
1111
{{- include "jupyterhub.labels" . | nindent 4 }}
12+
hub.jupyter.org/deletable: "true"
1213
annotations:
1314
"helm.sh/hook": pre-install,pre-upgrade
14-
"helm.sh/hook-weight": "-30"
15+
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
16+
"helm.sh/hook-weight": "0"
1517
{{- with .Values.prePuller.hook.serviceAccount.annotations }}
1618
{{- . | toYaml | nindent 4 }}
1719
{{- end }}

0 commit comments

Comments
 (0)