Skip to content

Commit

Permalink
Improve logger script
Browse files Browse the repository at this point in the history
Log START, UPDATE, and STOP events to make it easier to verify failover
and relocate.

Based on ramen logger for the cirros image:
RamenDR/ramen#1105

Signed-off-by: Nir Soffer <nsoffer@redhat.com>
  • Loading branch information
nirs committed Nov 14, 2023
1 parent 855d757 commit 13e0d9e
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion busybox/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 13e0d9e

Please sign in to comment.