Skip to content

Commit

Permalink
feat: ✨ Added Lifecycle Hook and Termination Grace Preriod to Trino W…
Browse files Browse the repository at this point in the history
…orker deployment
  • Loading branch information
danielcrisap committed Aug 22, 2023
1 parent 2e96887 commit 6a2599c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions charts/trino/templates/deployment-worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ spec:
{{- end }}
imagePullSecrets:
{{- toYaml .Values.imagePullSecrets | nindent 8 }}
terminationGracePeriodSeconds: {{ .Values.worker.terminationGracePeriodSeconds | default 30 }}
containers:
- name: {{ .Chart.Name }}-worker
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
Expand Down Expand Up @@ -99,6 +100,8 @@ spec:
timeoutSeconds: {{ .Values.worker.readinessProbe.timeoutSeconds | default 5 }}
failureThreshold: {{ .Values.worker.readinessProbe.failureThreshold | default 6 }}
successThreshold: {{ .Values.worker.readinessProbe.successThreshold | default 1 }}
lifecycle:
{{- toYaml .Values.worker.lifecycle | nindent 12 }}
resources:
{{- toYaml .Values.worker.resources | nindent 12 }}
{{- with .Values.worker.nodeSelector }}
Expand Down
11 changes: 11 additions & 0 deletions charts/trino/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,17 @@ worker:
# failureThreshold: 6
# successThreshold: 1

lifecycle: {}
# preStop:
# exec:
# command: ["/bin/sh", "-c", "curl -v -X PUT -d '\"SHUTTING_DOWN\"' -H \"Content-type: application/json\" http://localhost:8081/v1/info/state"]
# https://trino.io/docs/current/admin/graceful-shutdown.html#admin-graceful-shutdown--page-root

terminationGracePeriodSeconds: ""
# Sleep for shutdown.grace-period, which defaults to 2 minutes.
# After this, the coordinator is aware of the shutdown and stops sending tasks to the worker.
# https://trino.io/docs/current/admin/graceful-shutdown.html#shutdown-behavior

nodeSelector: {}

tolerations: []
Expand Down

0 comments on commit 6a2599c

Please sign in to comment.