Unverified Commit f850b424 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #60951 from bmoyles0117/fix-fluentd-liveness-probe

Automatic merge from submit-queue (batch tested with PRs 60737, 60739, 61080, 60968, 60951). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Find most recent modified date for fluentd buffers recursively. Fixes #60762 **What this PR does / why we need it**: Due to updates in Fluent v0.14, the buffers directory modified date is no longer updated when files inside the directory are changed. Therefore we must find the most recent modified date recursively to fix liveness probe. **Release note**: ```release-note NONE ```
parents ae990bb5 a844523c
...@@ -61,14 +61,14 @@ spec: ...@@ -61,14 +61,14 @@ spec:
then then
exit 1; exit 1;
fi; fi;
LAST_MODIFIED_DATE=`stat /var/log/fluentd-buffers | grep Modify | sed -r "s/Modify: (.*)/\1/"`; touch -d "${STUCK_THRESHOLD_SECONDS} seconds ago" /tmp/marker-stuck;
LAST_MODIFIED_TIMESTAMP=`date -d "$LAST_MODIFIED_DATE" +%s`; if [[ -z "$(find /var/log/fluentd-buffers -type f -newer /tmp/marker-stuck -print -quit)" ]];
if [ `date +%s` -gt `expr $LAST_MODIFIED_TIMESTAMP + $STUCK_THRESHOLD_SECONDS` ];
then then
rm -rf /var/log/fluentd-buffers; rm -rf /var/log/fluentd-buffers;
exit 1; exit 1;
fi; fi;
if [ `date +%s` -gt `expr $LAST_MODIFIED_TIMESTAMP + $LIVENESS_THRESHOLD_SECONDS` ]; touch -d "${LIVENESS_THRESHOLD_SECONDS} seconds ago" /tmp/marker-liveness;
if [[ -z "$(find /var/log/fluentd-buffers -type f -newer /tmp/marker-liveness -print -quit)" ]];
then then
exit 1; exit 1;
fi; fi;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment