From 63842b96783e92fb7c4eae93f86ed160c82e893e Mon Sep 17 00:00:00 2001 From: "Ruben L. Mendoza" Date: Mon, 10 Jun 2024 12:23:31 -0500 Subject: [PATCH] Minute replication files - liveness check (#332) * Update minute replication liveness * Add livenessProbe for minute replication * Update initialDelaySeconds for minute rep * Update permission for liveness - minute rep --- images/replication-job/liveness.sh | 9 +++++++++ .../templates/jobs/replication-job-deployment.yaml | 10 ++++++++++ 2 files changed, 19 insertions(+) create mode 100755 images/replication-job/liveness.sh diff --git a/images/replication-job/liveness.sh b/images/replication-job/liveness.sh new file mode 100755 index 00000000..c343c24e --- /dev/null +++ b/images/replication-job/liveness.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +# This is a script for the complex evaluation of whether Osmosis or other processes are running in the container. +if [ $(ps -ef | grep -E 'java' | grep -v grep | wc -l) -ge 1 ]; then + echo "Osmosis is running." + exit 0 +else + echo "Osmosis is not running!" 1>&2 + exit 1 +fi diff --git a/osm-seed/templates/jobs/replication-job-deployment.yaml b/osm-seed/templates/jobs/replication-job-deployment.yaml index afc4ca75..fe2ea3a8 100644 --- a/osm-seed/templates/jobs/replication-job-deployment.yaml +++ b/osm-seed/templates/jobs/replication-job-deployment.yaml @@ -22,6 +22,16 @@ spec: - name: {{ .Release.Name }}-replication-job-deployment image: {{ .Values.replicationJob.image.name }}:{{ .Values.replicationJob.image.tag }} command: ['/start.sh'] + livenessProbe: + exec: + command: + - /bin/bash + - -c + - /liveness.sh + initialDelaySeconds: 10 + timeoutSeconds: 5 + periodSeconds: 10 + failureThreshold: 3 {{- if .Values.replicationJob.resources.enabled }} resources: requests: