@@ -51,14 +51,16 @@ spec:
51
51
per node limit all k8s clusters have and have a higher priority
52
52
than user-placeholder pods that could block an entire node.
53
53
*/} }
54
+ serviceAccount: taintmanager
55
+ serviceAccountName: taintmanager
54
56
{ {- if .Values.scheduling.podPriority.enabled } }
55
57
priorityClassName: { { include " jupyterhub.image-puller-priority.fullname" . } }
56
58
{ {- end } }
57
59
{ {- with .Values.singleuser.nodeSelector } }
58
60
nodeSelector:
59
61
{ {- . | toYaml | nindent 8 } }
60
62
{ {- 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 } }
62
64
tolerations:
63
65
{ {- . | toYaml | nindent 8 } }
64
66
{ {- end } }
@@ -70,11 +72,39 @@ spec:
70
72
{ {- include " jupyterhub.userNodeAffinityRequired" . | nindent 14 } }
71
73
{ {- end } }
72
74
terminationGracePeriodSeconds: 0
73
- automountServiceAccountToken: false
75
+ automountServiceAccountToken: true
74
76
{ {- with include " jupyterhub.imagePullSecrets" (dict " root" . " image" .Values.singleuser.image) } }
75
77
imagePullSecrets: { { . } }
76
78
{ {- end } }
77
79
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 } }
78
108
{ {- /* --- Conditionally pull an image all user pods will use in an initContainer --- */} }
79
109
{ {- $blockWithIptables := hasKey .Values.singleuser.cloudMetadata " enabled" | ternary (not .Values.singleuser.cloudMetadata.enabled) .Values.singleuser.cloudMetadata.blockWithIptables } }
80
110
{ {- if $blockWithIptables } }
@@ -172,6 +202,34 @@ spec:
172
202
{{- . | toYaml | nindent 12 }}
173
203
{{- end }}
174
204
{{- 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 }}
175
233
containers:
176
234
- name: pause
177
235
image: {{ .Values.prePuller.pause.image.name }}:{{ .Values.prePuller.pause.image.tag }}
0 commit comments