From ab1ff087d21e6f523c035b2061f06b490d60bf1d Mon Sep 17 00:00:00 2001 From: David Burke Date: Thu, 20 Apr 2023 20:34:16 -0400 Subject: [PATCH] Add optional celery liveness check --- templates/worker/deployment.yaml | 8 ++++++++ values.yaml | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/templates/worker/deployment.yaml b/templates/worker/deployment.yaml index 736cebd..2e9c9ac 100644 --- a/templates/worker/deployment.yaml +++ b/templates/worker/deployment.yaml @@ -41,6 +41,14 @@ spec: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy }} + {{- if .Values.worker.livenessProbe.enabled }} + livenessProbe: + initialDelaySeconds: {{ .Values.worker.livenessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.worker.livenessProbe.periodSeconds }} + timeoutSeconds: {{ .Values.worker.livenessProbe.timeoutSeconds }} + exec: + command: {{ .Values.worker.livenessProbe.command }} + {{- end }} resources: {{- toYaml .Values.worker.resources | nindent 12 }} env: diff --git a/values.yaml b/values.yaml index 7f6ad0c..947014e 100644 --- a/values.yaml +++ b/values.yaml @@ -97,6 +97,13 @@ worker: maxReplicas: 100 targetCPUUtilizationPercentage: 90 # targetMemoryUtilizationPercentage: 80 + livenessProbe: + enabled: false + initialDelaySeconds: 30 + periodSeconds: 300 + timeoutSeconds: 30 + command: + - "celery -A django inspect ping -d celery@$HOSTNAME" resources: limits: cpu: 900m