mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 09:22:44 +00:00
Merge pull request #40012 from Crassirostris/fluentd-liveness-probe-sync
Automatic merge from submit-queue (batch tested with PRs 39911, 40002, 39969, 40012, 40009) Sync fluentd daemonset liveness probe with static pod liveness probe Syncing change from https://github.com/kubernetes/kubernetes/pull/39949 Should also be cherry-picked
This commit is contained in:
commit
936a94f0a8
@ -51,10 +51,23 @@ spec:
|
|||||||
- '/bin/sh'
|
- '/bin/sh'
|
||||||
- '-c'
|
- '-c'
|
||||||
- >
|
- >
|
||||||
LIVENESS_THRESHOLD_SECONDS=${LIVENESS_THRESHOLD_SECONDS:-600};
|
LIVENESS_THRESHOLD_SECONDS=${LIVENESS_THRESHOLD_SECONDS:-300};
|
||||||
|
STUCK_THRESHOLD_SECONDS=${LIVENESS_THRESHOLD_SECONDS:-900};
|
||||||
|
if [ ! -e /var/log/fluentd-buffers ];
|
||||||
|
then
|
||||||
|
exit 1;
|
||||||
|
fi;
|
||||||
LAST_MODIFIED_DATE=`stat /var/log/fluentd-buffers | grep Modify | sed -r "s/Modify: (.*)/\1/"`;
|
LAST_MODIFIED_DATE=`stat /var/log/fluentd-buffers | grep Modify | sed -r "s/Modify: (.*)/\1/"`;
|
||||||
LAST_MODIFIED_TIMESTAMP=`date -d "$LAST_MODIFIED_DATE" +%s`;
|
LAST_MODIFIED_TIMESTAMP=`date -d "$LAST_MODIFIED_DATE" +%s`;
|
||||||
if [ `date +%s` -gt `expr $LAST_MODIFIED_TIMESTAMP + $LIVENESS_THRESHOLD_SECONDS` ]; then exit 1; fi;
|
if [ `date +%s` -gt `expr $LAST_MODIFIED_TIMESTAMP + $STUCK_THRESHOLD_SECONDS` ];
|
||||||
|
then
|
||||||
|
rm -rf /var/log/fluentd-buffers;
|
||||||
|
exit 1;
|
||||||
|
fi;
|
||||||
|
if [ `date +%s` -gt `expr $LAST_MODIFIED_TIMESTAMP + $LIVENESS_THRESHOLD_SECONDS` ];
|
||||||
|
then
|
||||||
|
exit 1;
|
||||||
|
fi;
|
||||||
terminationGracePeriodSeconds: 30
|
terminationGracePeriodSeconds: 30
|
||||||
volumes:
|
volumes:
|
||||||
- name: varlog
|
- name: varlog
|
||||||
|
Loading…
Reference in New Issue
Block a user