Skip to content

Commit d0ec9a2

Browse files
authored
feat(charts): add eviction tolerations to the provisioner deployment (#238)
* feat(charts): add eviction tolerations to the provisioner deployment Signed-off-by: Niladri Halder <[email protected]> * ci: omit the timeout flag on ct lint Signed-off-by: Niladri Halder <[email protected]> --------- Signed-off-by: Niladri Halder <[email protected]>
1 parent b3b69bf commit d0ec9a2

File tree

4 files changed

+27
-4
lines changed

4 files changed

+27
-4
lines changed

ct.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ remote: origin
33
target-branch: develop
44
chart-dirs:
55
- deploy/helm
6-
helm-extra-args: --timeout=500s
6+
# helm-extra-args: --timeout=500s
77
validate-maintainers: false
88
check-version-increment: false

deploy/helm/charts/templates/_helpers.tpl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,17 @@ Create the name of the service account to use
7575
{{ default "default" .Values.serviceAccount.name }}
7676
{{- end -}}
7777
{{- end -}}
78+
79+
{{/*
80+
Creates the tolerations based on the global tolerations, with early eviction
81+
Usage:
82+
{{ include "tolerations_with_early_eviction" . }}
83+
*/}}
84+
{{- define "tolerations_with_early_eviction" -}}
85+
{{- if .Values.earlyEvictionTolerations }}
86+
{{- toYaml .Values.earlyEvictionTolerations | nindent 8 }}
87+
{{- end }}
88+
{{- if .Values.localpv.tolerations }}
89+
{{- toYaml .Values.localpv.tolerations | nindent 8 }}
90+
{{- end }}
91+
{{- end }}

deploy/helm/charts/templates/deployment.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,8 @@ spec:
120120
nodeSelector:
121121
{{ toYaml .Values.localpv.nodeSelector | indent 8 }}
122122
{{- end }}
123-
{{- if .Values.localpv.tolerations }}
124-
tolerations:
125-
{{ toYaml .Values.localpv.tolerations | indent 8 }}
123+
{{- if $tolerations := include "tolerations_with_early_eviction" . }}
124+
tolerations: {{ $tolerations }}
126125
{{- end }}
127126
{{- if .Values.localpv.affinity }}
128127
affinity:

deploy/helm/charts/values.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ rbac:
1313
# rbac.pspEnabled: `true` if PodSecurityPolicy resources should be created
1414
pspEnabled: false
1515

16+
earlyEvictionTolerations:
17+
- effect: NoExecute
18+
key: node.kubernetes.io/unreachable
19+
operator: Exists
20+
tolerationSeconds: 5
21+
- effect: NoExecute
22+
key: node.kubernetes.io/not-ready
23+
operator: Exists
24+
tolerationSeconds: 5
25+
1626
localpv:
1727
name: localpv-provisioner
1828
enabled: true

0 commit comments

Comments
 (0)