@@ -51,14 +51,16 @@ spec:
5151 per node limit all k8s clusters have and have a higher priority
5252 than user-placeholder pods that could block an entire node.
5353 */} }
54+ serviceAccount: taintmanager
55+ serviceAccountName: taintmanager
5456 { {- if .Values.scheduling.podPriority.enabled } }
5557 priorityClassName: { { include " jupyterhub.image-puller-priority.fullname" . } }
5658 { {- end } }
5759 { {- with .Values.singleuser.nodeSelector } }
5860 nodeSelector:
5961 { {- . | toYaml | nindent 8 } }
6062 { {- end } }
61- { {- with concat .Values.scheduling.userPods.tolerations .Values.singleuser.extraTolerations .Values.prePuller.extraTolerations } }
63+ { {- with concat .Values.scheduling.userPods.tolerations .Values.singleuser.extraTolerations .Values.prePuller.extraTolerations .Values.prePuller.taintmanager.tolerations } }
6264 tolerations:
6365 { {- . | toYaml | nindent 8 } }
6466 { {- end } }
@@ -70,11 +72,39 @@ spec:
7072 { {- include " jupyterhub.userNodeAffinityRequired" . | nindent 14 } }
7173 { {- end } }
7274 terminationGracePeriodSeconds: 0
73- automountServiceAccountToken: false
75+ automountServiceAccountToken: true
7476 { {- with include " jupyterhub.imagePullSecrets" (dict " root" . " image" .Values.singleuser.image) } }
7577 imagePullSecrets: { { . } }
7678 { {- end } }
7779 initContainers:
80+ { {- if .Values.prePuller.taintmanager.enabled } }
81+ { {- $taint := first .Values.prePuller.taintmanager.tolerations } }
82+ - name: taintmanager-adding
83+ image: { { .Values.prePuller.taintmanager.image.name } }:{ { .Values.prePuller.taintmanager.image.tag } }
84+ command:
85+ - /taintmanager
86+ - -add
87+ - { { $taint .key } }:{ { $taint .effect } }
88+ env:
89+ - name: GODEBUG
90+ value: x509sha1=1
91+ - name: MY_POD_NAME
92+ valueFrom:
93+ fieldRef:
94+ fieldPath: metadata.name
95+ - name: MY_NODE_NAME
96+ valueFrom:
97+ fieldRef:
98+ fieldPath: spec.nodeName
99+ { {- with .Values.prePuller.resources } }
100+ resources:
101+ { {- . | toYaml | nindent 12 } }
102+ { {- end } }
103+ { {- with .Values.prePuller.containerSecurityContext } }
104+ securityContext:
105+ { {- . | toYaml | nindent 12 } }
106+ { {- end } }
107+ { {- end } }
78108 { {- /* --- Conditionally pull an image all user pods will use in an initContainer --- */} }
79109 { {- $blockWithIptables := hasKey .Values.singleuser.cloudMetadata " enabled" | ternary (not .Values.singleuser.cloudMetadata.enabled) .Values.singleuser.cloudMetadata.blockWithIptables } }
80110 { {- if $blockWithIptables } }
@@ -172,6 +202,34 @@ spec:
172202 {{- . | toYaml | nindent 12 }}
173203 {{- end }}
174204 {{- end }}
205+ {{- if .Values.prePuller.taintmanager.enabled }}
206+ {{- $taint := first .Values.prePuller.taintmanager.tolerations }}
207+ - name: taintmanager-removing
208+ image: {{ .Values.prePuller.taintmanager.image.name }}:{{ .Values.prePuller.taintmanager.image.tag }}
209+ command:
210+ - /taintmanager
211+ - -remove
212+ - {{ $taint.key }}:{{ $taint.effect }}
213+ env:
214+ - name: GODEBUG
215+ value: x509sha1=1
216+ - name: MY_POD_NAME
217+ valueFrom:
218+ fieldRef:
219+ fieldPath: metadata.name
220+ - name: MY_NODE_NAME
221+ valueFrom:
222+ fieldRef:
223+ fieldPath: spec.nodeName
224+ {{- with .Values.prePuller.resources }}
225+ resources:
226+ {{- . | toYaml | nindent 12 }}
227+ {{- end }}
228+ {{- with .Values.prePuller.containerSecurityContext }}
229+ securityContext:
230+ {{- . | toYaml | nindent 12 }}
231+ {{- end }}
232+ {{- end }}
175233 containers:
176234 - name: pause
177235 image: {{ .Values.prePuller.pause.image.name }}:{{ .Values.prePuller.pause.image.tag }}
0 commit comments