mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-14 14:23:37 +00:00
Sync fluentd daemonset liveness probe with static pod liveness probe
This commit is contained in:
parent
0bd13332e9
commit
5b96233423
@ -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