From 11579f87fc1d80a4a28a7aacb33821483ffd6705 Mon Sep 17 00:00:00 2001 From: Kevin Huang Date: Wed, 30 Nov 2022 13:45:46 +0100 Subject: [PATCH] feat(fluentd): Make buffer path configurable in livenessProbe (#133) Signed-off-by: Kevin Huang Signed-off-by: Kevin Huang --- charts/fluentd-elasticsearch/Chart.yaml | 2 +- charts/fluentd-elasticsearch/values.yaml | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/charts/fluentd-elasticsearch/Chart.yaml b/charts/fluentd-elasticsearch/Chart.yaml index 2fdc3a7..d4070cd 100755 --- a/charts/fluentd-elasticsearch/Chart.yaml +++ b/charts/fluentd-elasticsearch/Chart.yaml @@ -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/ diff --git a/charts/fluentd-elasticsearch/values.yaml b/charts/fluentd-elasticsearch/values.yaml index 3e220a6..a09a7fc 100755 --- a/charts/fluentd-elasticsearch/values.yaml +++ b/charts/fluentd-elasticsearch/values.yaml @@ -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: [] @@ -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;