Skip to content

Commit

Permalink
chart needs to export the same variable as the image entrypoint in or…
Browse files Browse the repository at this point in the history
…der for leader detection to work

Signed-off-by: metron2 <[email protected]>
  • Loading branch information
metron2 committed Jun 5, 2024
1 parent c2a7864 commit fb79ffe
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions charts/graylog/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,9 @@ data:
transport_email_web_interface_url = {{ $externalUri }}
{{- end }}
content_packs_dir = /usr/share/graylog/data/contentpacks
{{- if semverCompare "~5" ( $graylogVersion ) }}
content_packs_auto_load = grok-patterns.json
{{- end}}
proxied_requests_thread_pool_size = 32
{{- if .Values.graylog.metrics.enabled }}
prometheus_exporter_enabled = true
Expand Down Expand Up @@ -199,6 +201,15 @@ data:
{{- end }}
# Start Graylog
echo "Starting graylog"
if [[ ! -z "${POD_NAME}" ]]
then
if echo "${POD_NAME}" | grep "\\-0$" >/dev/null
then
export GRAYLOG_IS_LEADER="true"
else
export GRAYLOG_IS_LEADER="false"
fi
fi
# Original docker-entrypoint.sh in Graylog Docker will error while executing since you can't chown readonly files in `config`
# exec /docker-entrypoint.sh graylog
{{- if or (.Values.graylog.opensearch.uriSecretKey) (.Values.graylog.mongodb.uriSecretKey) }}
Expand All @@ -209,6 +220,7 @@ data:
export GRAYLOG_ELASTICSEARCH_VERSION={{ .Values.graylog.opensearch.version }}
{{- end }}
echo "Graylog Home ${GRAYLOG_HOME}"
echo "Graylog Leader ${GRAYLOG_IS_LEADER}"
echo "Graylog Plugin Dir ${GRAYLOG_PLUGIN_DIR}"
echo "Graylog Elasticsearch Version ${GRAYLOG_ELASTICSEARCH_VERSION}"
"${JAVA_HOME}/bin/java" \
Expand Down

0 comments on commit fb79ffe

Please sign in to comment.