Skip to content

Commit

Permalink
feat(fluentd): Make buffer path configurable in livenessProbe (#133)
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Huang <[email protected]>

Signed-off-by: Kevin Huang <[email protected]>
  • Loading branch information
huangkevin404 authored Nov 30, 2022
1 parent d1d811f commit 11579f8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion charts/fluentd-elasticsearch/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: fluentd-elasticsearch
version: 13.7.1
version: 13.8.0
appVersion: v4.2.3
type: application
home: https://www.fluentd.org/
Expand Down
16 changes: 9 additions & 7 deletions charts/fluentd-elasticsearch/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ env: {}
# OUTPUT_USER: my_user
# LIVENESS_THRESHOLD_SECONDS: 300
# STUCK_THRESHOLD_SECONDS: 900
# BUFFER_PATH: /var/log/fluentd-buffers/kubernetes.system.buffer

# If you want to add custom environment variables from secrets, use the secret list
secret: []
Expand Down Expand Up @@ -198,22 +199,23 @@ livenessProbe:
- >
LIVENESS_THRESHOLD_SECONDS=${LIVENESS_THRESHOLD_SECONDS:-300};
STUCK_THRESHOLD_SECONDS=${STUCK_THRESHOLD_SECONDS:-900};
if [ ! -e /var/log/fluentd-buffers ];
BUFFER_PATH=${BUFFER_PATH:-/var/log/fluentd-buffers/kubernetes.system.buffer}
if [ ! -e ${BUFFER_PATH} ];
then
echo "Expected directory /var/log/fluentd-buffers does not exist. This is likely a configuration issue.";
echo "Expected file ${BUFFER_PATH} does not exist. This is likely a configuration issue.";
exit 1;
fi;
touch -d "${STUCK_THRESHOLD_SECONDS} seconds ago" /tmp/marker-stuck;
if [ -n "$(find /var/log/fluentd-buffers -mindepth 1 -type d ! -newer /tmp/marker-stuck -print -quit)" ];
if [ -n "$(find ${BUFFER_PATH} -mindepth 1 -type d ! -newer /tmp/marker-stuck -print -quit)" ];
then
echo "Elasticsearch buffers found stuck longer than $STUCK_THRESHOLD_SECONDS seconds. Clearing buffers."
rm -rf /var/log/fluentd-buffers;
echo "Elasticsearch buffer found stuck longer than $STUCK_THRESHOLD_SECONDS seconds. Clearing buffer."
rm -rf ${BUFFER_PATH};
exit 1;
fi;
touch -d "${LIVENESS_THRESHOLD_SECONDS} seconds ago" /tmp/marker-liveness;
if [ -n "$(find /var/log/fluentd-buffers -mindepth 1 -type d ! -newer /tmp/marker-liveness -print -quit)" ];
if [ -n "$(find ${BUFFER_PATH} -mindepth 1 -type d ! -newer /tmp/marker-liveness -print -quit)" ];
then
echo "Elasticsearch buffers found stuck longer than $LIVENESS_THRESHOLD_SECONDS seconds."
echo "Elasticsearch buffer found stuck longer than $LIVENESS_THRESHOLD_SECONDS seconds."
exit 1;
fi;
Expand Down

0 comments on commit 11579f8

Please sign in to comment.