From fd01dc23d811880f6b39e5cf12da485cb8b94853 Mon Sep 17 00:00:00 2001 From: Melody Zhao Date: Fri, 25 Oct 2024 15:06:47 +0800 Subject: [PATCH 1/2] make liveness probe timeout configurable --- templates/events-worker-deployment.yaml | 4 ++++ templates/worker-deployment.yaml | 4 ++++ values.yaml | 10 ++++++++++ 3 files changed, 18 insertions(+) diff --git a/templates/events-worker-deployment.yaml b/templates/events-worker-deployment.yaml index ffb1546..5fa7071 100644 --- a/templates/events-worker-deployment.yaml +++ b/templates/events-worker-deployment.yaml @@ -116,5 +116,9 @@ spec: livenessProbe: exec: command: ["/bin/bash", "-l", "-c", "bundle exec sidekiqmon processes | grep $(hostname) || exit 1"] + initialDelaySeconds: {{ .Values.eventsWorker.livenessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.eventsWorker.livenessProbe.periodSeconds }} + timeoutSeconds: {{ .Values.eventsWorker.livenessProbe.timeoutSeconds }} + failureThreshold: {{ .Values.eventsWorker.livenessProbe.failureThreshold }} restartPolicy: Always serviceAccountName: {{ .Values.global.serviceAccountName | default (printf "%s-serviceaccount" .Release.Name) }} diff --git a/templates/worker-deployment.yaml b/templates/worker-deployment.yaml index 1c7eedd..4bcf2b0 100644 --- a/templates/worker-deployment.yaml +++ b/templates/worker-deployment.yaml @@ -172,6 +172,10 @@ spec: livenessProbe: exec: command: ["/bin/bash", "-l", "-c", "bundle exec sidekiqmon processes | grep $(hostname) || exit 1"] + initialDelaySeconds: {{ .Values.worker.livenessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.worker.livenessProbe.periodSeconds }} + timeoutSeconds: {{ .Values.worker.livenessProbe.timeoutSeconds }} + failureThreshold: {{ .Values.worker.livenessProbe.failureThreshold }} {{- with .Values.worker.resources }} resources: {{- toYaml . | nindent 12}} diff --git a/values.yaml b/values.yaml index b72c670..82525bf 100644 --- a/values.yaml +++ b/values.yaml @@ -143,6 +143,11 @@ worker: podAnnotations: {} podLabels: {} extraEnv: {} + livenessProbe: + initialDelaySeconds: 0 + periodSeconds: 10 + timeoutSeconds: 1 + failureThreshold: 3 eventsWorker: replicas: 1 @@ -158,6 +163,11 @@ eventsWorker: podAnnotations: {} podLabels: {} extraEnv: {} + livenessProbe: + initialDelaySeconds: 0 + periodSeconds: 10 + timeoutSeconds: 1 + failureThreshold: 3 clock: From 769ae5dc5c0088715a9d2de2b32f2cacc901ce19 Mon Sep 17 00:00:00 2001 From: Melody Zhao Date: Tue, 29 Oct 2024 10:40:43 +0800 Subject: [PATCH 2/2] address comments --- templates/events-worker-deployment.yaml | 8 ++++---- templates/worker-deployment.yaml | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/templates/events-worker-deployment.yaml b/templates/events-worker-deployment.yaml index 5fa7071..87d203a 100644 --- a/templates/events-worker-deployment.yaml +++ b/templates/events-worker-deployment.yaml @@ -116,9 +116,9 @@ spec: livenessProbe: exec: command: ["/bin/bash", "-l", "-c", "bundle exec sidekiqmon processes | grep $(hostname) || exit 1"] - initialDelaySeconds: {{ .Values.eventsWorker.livenessProbe.initialDelaySeconds }} - periodSeconds: {{ .Values.eventsWorker.livenessProbe.periodSeconds }} - timeoutSeconds: {{ .Values.eventsWorker.livenessProbe.timeoutSeconds }} - failureThreshold: {{ .Values.eventsWorker.livenessProbe.failureThreshold }} + initialDelaySeconds: {{ .Values.eventsWorker.livenessProbe.initialDelaySeconds | default 0 }} + periodSeconds: {{ .Values.eventsWorker.livenessProbe.periodSeconds | default 10 }} + timeoutSeconds: {{ .Values.eventsWorker.livenessProbe.timeoutSeconds | default 1 }} + failureThreshold: {{ .Values.eventsWorker.livenessProbe.failureThreshold | default 3 }} restartPolicy: Always serviceAccountName: {{ .Values.global.serviceAccountName | default (printf "%s-serviceaccount" .Release.Name) }} diff --git a/templates/worker-deployment.yaml b/templates/worker-deployment.yaml index 4bcf2b0..c167a8e 100644 --- a/templates/worker-deployment.yaml +++ b/templates/worker-deployment.yaml @@ -172,10 +172,10 @@ spec: livenessProbe: exec: command: ["/bin/bash", "-l", "-c", "bundle exec sidekiqmon processes | grep $(hostname) || exit 1"] - initialDelaySeconds: {{ .Values.worker.livenessProbe.initialDelaySeconds }} - periodSeconds: {{ .Values.worker.livenessProbe.periodSeconds }} - timeoutSeconds: {{ .Values.worker.livenessProbe.timeoutSeconds }} - failureThreshold: {{ .Values.worker.livenessProbe.failureThreshold }} + initialDelaySeconds: {{ .Values.worker.livenessProbe.initialDelaySeconds | default 0 }} + periodSeconds: {{ .Values.worker.livenessProbe.periodSeconds | default 10 }} + timeoutSeconds: {{ .Values.worker.livenessProbe.timeoutSeconds | default 1 }} + failureThreshold: {{ .Values.worker.livenessProbe.failureThreshold | default 3 }} {{- with .Values.worker.resources }} resources: {{- toYaml . | nindent 12}}