From ea746ef9eb480d8e7b975e988a4751c6ab4c8210 Mon Sep 17 00:00:00 2001 From: shubhwip Date: Wed, 29 Mar 2023 13:13:53 +0100 Subject: [PATCH] Add liveness checks Update README file closes #72 --- README.md | 3 +++ templates/adhocworker-deployment.yaml | 2 ++ templates/genericworker-deployment.yaml | 2 ++ templates/scheduledworker-deployment.yaml | 2 ++ values.yaml | 30 +++++++++++++++++++++++ 5 files changed, 39 insertions(+) diff --git a/README.md b/README.md index eecb756..0433729 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,7 @@ The following table lists the configurable parameters of the Redash chart and th | ----------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | adhocWorker.affinity | object | `{}` | Affinity for ad-hoc worker pod assignment [ref](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity) | | adhocWorker.env | object | `{"QUEUES":"queries","WORKERS_COUNT":2}` | Redash ad-hoc worker specific environment variables. | +| adhocWorker.livenessProbe | string | `nil` | Redash ad-hoc worker liveness probe to ensure adhoc workers are running fine. | | adhocWorker.nodeSelector | object | `{}` | Node labels for ad-hoc worker pod assignment [ref](https://kubernetes.io/docs/user-guide/node-selection/) | | adhocWorker.podAnnotations | object | `{}` | Annotations for adhoc worker pod assignment [ref](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) | | adhocWorker.podLabels | object | `{}` | Labels for adhoc worker pod assignment [ref](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) | @@ -96,6 +97,7 @@ The following table lists the configurable parameters of the Redash chart and th | fullnameOverride | string | `""` | | | genericWorker.affinity | object | `{}` | Affinity for generic worker pod assignment [ref](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity) | | genericWorker.env | object | `{"QUEUES":"periodic,emails,default","WORKERS_COUNT":1}` | Redash generic worker specific environment variables. | +| genericWorker.livenessProbe | string | `nil` | Redash generic worker liveness probe to ensure generic workers are running fine. | | genericWorker.nodeSelector | object | `{}` | Node labels for generic worker pod assignment [ref](https://kubernetes.io/docs/user-guide/node-selection/) | | genericWorker.podAnnotations | object | `{}` | Annotations for generic worker pod assignment [ref](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) | | genericWorker.podLabels | object | `{}` | Labels for generic worker pod assignment [ref](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) | @@ -235,6 +237,7 @@ The following table lists the configurable parameters of the Redash chart and th | redis.master.port | int | `6379` | Redis master port to use (when redis chart enabled) | | scheduledWorker.affinity | object | `{}` | Affinity for scheduled worker pod assignment [ref](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity) | | scheduledWorker.env | object | `{"QUEUES":"scheduled_queries,schemas","WORKERS_COUNT":1}` | Redash scheduled worker specific environment variables. | +| scheduledWorker.livenessProbe | string | `nil` | Redash scheduled worker liveness probe to ensure scheduled workers are running fine. | | scheduledWorker.nodeSelector | object | `{}` | Node labels for scheduled worker pod assignment [ref](https://kubernetes.io/docs/user-guide/node-selection/) | | scheduledWorker.podAnnotations | object | `{}` | Annotations for scheduled worker pod assignment [ref](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) | | scheduledWorker.podLabels | object | `{}` | Labels for scheduled worker pod assignment [ref](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) | diff --git a/templates/adhocworker-deployment.yaml b/templates/adhocworker-deployment.yaml index 951e0ce..1d8280d 100644 --- a/templates/adhocworker-deployment.yaml +++ b/templates/adhocworker-deployment.yaml @@ -45,6 +45,8 @@ spec: {{- with .Values.adhocWorker.volumeMounts }} {{- toYaml . | nindent 12 }} {{- end }} + livenessProbe: +{{ toYaml .Values.adhocWorker.livenessProbe | indent 12 }} env: {{- include "redash.env" . | nindent 12 }} {{- range $key, $value := .Values.adhocWorker.env }} diff --git a/templates/genericworker-deployment.yaml b/templates/genericworker-deployment.yaml index 10d075c..b8a4e18 100644 --- a/templates/genericworker-deployment.yaml +++ b/templates/genericworker-deployment.yaml @@ -45,6 +45,8 @@ spec: {{- with .Values.genericWorker.volumeMounts }} {{- toYaml . | nindent 12 }} {{- end }} + livenessProbe: +{{ toYaml .Values.genericWorker.livenessProbe | indent 12 }} env: {{- include "redash.env" . | nindent 12 }} {{- range $key, $value := .Values.genericWorker.env }} diff --git a/templates/scheduledworker-deployment.yaml b/templates/scheduledworker-deployment.yaml index baa34af..cdd7241 100644 --- a/templates/scheduledworker-deployment.yaml +++ b/templates/scheduledworker-deployment.yaml @@ -45,6 +45,8 @@ spec: {{- with .Values.scheduledWorker.volumeMounts }} {{- toYaml . | nindent 12 }} {{- end }} + livenessProbe: +{{ toYaml .Values.scheduledWorker.livenessProbe | indent 12 }} env: {{- include "redash.env" . | nindent 12 }} {{- range $key, $value := .Values.scheduledWorker.env }} diff --git a/values.yaml b/values.yaml index c42700e..4acbd9a 100644 --- a/values.yaml +++ b/values.yaml @@ -401,6 +401,16 @@ adhocWorker: # adhocWorker.volumeMounts -- VolumeMounts for ad-hoc worker pod assignment [ref](https://kubernetes.io/docs/concepts/storage/volumes/) volumeMounts: [] + # adhocWorker.livenessProbe -- liveness probe to ensure adhoc workers are running fine + livenessProbe: + # exec: + # command: + # - /bin/sh + # - -c + # - /app/bin/docker-entrypoint workers_healthcheck + # initialDelaySeconds: 60 + # periodSeconds: 100 + ## Configuration for Redash scheduled workers scheduledWorker: # scheduledWorker.env -- Redash scheduled worker specific environment variables. @@ -445,6 +455,16 @@ scheduledWorker: # scheduledWorker.volumeMounts -- VolumeMounts for scheduled worker pod assignment [ref](https://kubernetes.io/docs/concepts/storage/volumes/) volumeMounts: [] + # scheduledWorker.livenessProbe -- liveness probe to ensure scheduled workers are running fine + livenessProbe: + # exec: + # command: + # - /bin/sh + # - -c + # - /app/bin/docker-entrypoint workers_healthcheck + # initialDelaySeconds: 60 + # periodSeconds: 100 + ## Configuration for Redash scheduler scheduler: # scheduler.env -- Redash scheduler specific environment variables. @@ -528,6 +548,16 @@ genericWorker: # genericWorker.volumeMounts -- VolumeMounts for generic worker pod assignment [ref](https://kubernetes.io/docs/concepts/storage/volumes/) volumeMounts: [] + # genericWorker.livenessProbe -- liveness probe to ensure generic workers are running fine + livenessProbe: + # exec: + # command: + # - /bin/sh + # - -c + # - /app/bin/docker-entrypoint workers_healthcheck + # initialDelaySeconds: 60 + # periodSeconds: 100 + ## Configuration for hook-install-job hookInstallJob: # hookInstallJob.ttlSecondsAfterFinished -- ttl for install job [ref](https://kubernetes.io/docs/concepts/workloads/controllers/ttlafterfinished/)