diff --git a/incubator/fluentd-elasticsearch/Chart.yaml b/incubator/fluentd-elasticsearch/Chart.yaml index 5f4a99c166..3996501456 100644 --- a/incubator/fluentd-elasticsearch/Chart.yaml +++ b/incubator/fluentd-elasticsearch/Chart.yaml @@ -1,5 +1,5 @@ name: fluentd-elasticsearch -version: 0.4.2 +version: 0.5.0 appVersion: 2.0.4 home: https://www.fluentd.org/ description: A Fluentd Helm chart for Kubernetes with Elasticsearch output diff --git a/incubator/fluentd-elasticsearch/README.md b/incubator/fluentd-elasticsearch/README.md index ee113613d7..2d09a66598 100644 --- a/incubator/fluentd-elasticsearch/README.md +++ b/incubator/fluentd-elasticsearch/README.md @@ -60,6 +60,7 @@ The following table lists the configurable parameters of the Fluentd elasticsear | `resources.requests.memory` | Memory request | `200Mi` | | `serviceAccount.create` | Specifies whether a service account should be created.| `true` | | `serviceAccount.name` | Name of the service account. | | +| `livenessProbe.enabled` | Wether to enable livenessProbe | `true` | | `tolerations` | Optional daemonset tolerations | `NULL` | diff --git a/incubator/fluentd-elasticsearch/templates/daemonset.yaml b/incubator/fluentd-elasticsearch/templates/daemonset.yaml index 3cfedac14b..bb4bcddfa9 100644 --- a/incubator/fluentd-elasticsearch/templates/daemonset.yaml +++ b/incubator/fluentd-elasticsearch/templates/daemonset.yaml @@ -70,6 +70,40 @@ spec: {{- if .Values.extraVolumeMounts }} {{ toYaml .Values.extraVolumeMounts | indent 8 }} {{- end }} +{{- if .Values.livenessProbe.enabled }} + # Liveness probe is aimed to help in situarions where fluentd + # silently hangs for no apparent reasons until manual restart. + # The idea of this probe is that if fluentd is not queueing or + # flushing chunks for 5 minutes, something is not right. If + # you want to change the fluentd configuration, reducing amount of + # logs fluentd collects, consider changing the threshold or turning + # liveness probe off completely. + livenessProbe: + initialDelaySeconds: 600 + periodSeconds: 60 + exec: + command: + - '/bin/sh' + - '-c' + - > + LIVENESS_THRESHOLD_SECONDS=${LIVENESS_THRESHOLD_SECONDS:-300}; + STUCK_THRESHOLD_SECONDS=${LIVENESS_THRESHOLD_SECONDS:-900}; + if [ ! -e /var/log/fluentd-buffers ]; + then + exit 1; + fi; + touch -d "${STUCK_THRESHOLD_SECONDS} seconds ago" /tmp/marker-stuck; + if [[ -z "$(find /var/log/fluentd-buffers -type f -newer /tmp/marker-stuck -print -quit)" ]]; + then + rm -rf /var/log/fluentd-buffers; + exit 1; + fi; + 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 + exit 1; + fi; +{{- end }} terminationGracePeriodSeconds: 30 volumes: - name: varlog diff --git a/incubator/fluentd-elasticsearch/values.yaml b/incubator/fluentd-elasticsearch/values.yaml index 678ebeb491..f4fdbc07e0 100644 --- a/incubator/fluentd-elasticsearch/values.yaml +++ b/incubator/fluentd-elasticsearch/values.yaml @@ -33,6 +33,9 @@ serviceAccount: # If not set and create is true, a name is generated using the fullname template name: +livenessProbe: + enabled: true + annotations: {} # prometheus.io/scrape: "true" # prometheus.io/port: "24231"