@@ -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 } }
@@ -200,6 +230,34 @@ spec:
200230 {{- . | toYaml | nindent 12 }}
201231 {{- end }}
202232 {{- end }}
233+ {{- if .Values.prePuller.taintmanager.enabled }}
234+ {{- $taint := first .Values.prePuller.taintmanager.tolerations }}
235+ - name: taintmanager-removing
236+ image: {{ .Values.prePuller.taintmanager.image.name }}:{{ .Values.prePuller.taintmanager.image.tag }}
237+ command:
238+ - /taintmanager
239+ - -remove
240+ - {{ $taint.key }}:{{ $taint.effect }}
241+ env:
242+ - name: GODEBUG
243+ value: x509sha1=1
244+ - name: MY_POD_NAME
245+ valueFrom:
246+ fieldRef:
247+ fieldPath: metadata.name
248+ - name: MY_NODE_NAME
249+ valueFrom:
250+ fieldRef:
251+ fieldPath: spec.nodeName
252+ {{- with .Values.prePuller.resources }}
253+ resources:
254+ {{- . | toYaml | nindent 12 }}
255+ {{- end }}
256+ {{- with .Values.prePuller.containerSecurityContext }}
257+ securityContext:
258+ {{- . | toYaml | nindent 12 }}
259+ {{- end }}
260+ {{- end }}
203261 containers:
204262 - name: pause
205263 image: {{ .Values.prePuller.pause.image.name }}:{{ .Values.prePuller.pause.image.tag }}
0 commit comments