From 13e0d9e6a3869b9d6101ea212533742bdf970876 Mon Sep 17 00:00:00 2001 From: Nir Soffer Date: Mon, 13 Nov 2023 19:56:45 +0200 Subject: [PATCH] Improve logger script Log START, UPDATE, and STOP events to make it easier to verify failover and relocate. Based on ramen logger for the cirros image: https://github.com/RamenDR/ramen/pull/1105 Signed-off-by: Nir Soffer --- busybox/deployment.yaml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/busybox/deployment.yaml b/busybox/deployment.yaml index 277a12e..d2b1afc 100644 --- a/busybox/deployment.yaml +++ b/busybox/deployment.yaml @@ -17,7 +17,20 @@ spec: - name: logger image: quay.io/nirsof/busybox:stable imagePullPolicy: IfNotPresent - command: ['sh', '-c', 'trap exit TERM; while true; do echo $(date) | tee -a /var/log/ramen.log; sync; sleep 10 & wait; done'] + command: + - sh + - -c + - | + emit() { + echo "$(date) $1" | tee -a /var/log/ramen.log + sync + } + trap "emit STOP; exit" TERM + emit START + while true; do + sleep 10 & wait + emit UPDATE + done volumeMounts: - name: varlog mountPath: /var/log