Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

elasticsearch_hosts broken when using secret #104

Open
jpuskar opened this issue Jan 23, 2022 · 2 comments
Open

elasticsearch_hosts broken when using secret #104

jpuskar opened this issue Jan 23, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@jpuskar
Copy link

jpuskar commented Jan 23, 2022

Hi,
The new versions of the chart fail to launch graylog when using elasticsearch hosts in a secret.

Parameter elasticsearch_hosts must not contain URIs without host or scheme. (found [user:pass@graylog-es-http.graylog.svc:9200])"

However if I prefix the secret with https, then I get access issues because it seems that most parts of graylog honor GRAYLOG_ELASTICSEARCH_HOSTS but there are some scheduled index management jobs that appear to read only from graylog.conf.subst, which ends up as: http://https://user:pass@graylog-es-http.graylog.svc:9200. (notice the double-schema prefix).

I think to fix this you would just need to apply this patch, so that the startup script and the environment variable can produce consistent results.

The reason this was not a problem before, is that the chart was using "GRAYLOG_ELASTICSEARCH_HOST" which is not actually honored by Graylog, so it didn't override the graylog.conf setting.

diff --git a/charts/graylog/templates/_helpers.tpl b/charts/graylog/templates/_helpers.tpl
index ba0702f..58e3d48 100644
--- a/charts/graylog/templates/_helpers.tpl
+++ b/charts/graylog/templates/_helpers.tpl
@@ -92,9 +92,9 @@ Or use chart dependencies with release name
 {{- define "graylog.elasticsearch.hosts" -}}
 {{- if .Values.graylog.elasticsearch.uriSecretKey }}
     {{- if .Values.graylog.elasticsearch.uriSSL }}
-        {{- printf "https://${GRAYLOG_ELASTICSEARCH_HOSTS}" -}}
+        {{- printf "${GRAYLOG_ELASTICSEARCH_HOSTS}" -}}
     {{- else }}
-        {{- printf "http://${GRAYLOG_ELASTICSEARCH_HOSTS}" -}}
+        {{- printf "${GRAYLOG_ELASTICSEARCH_HOSTS}" -}}
     {{- end }}
 {{- else if .Values.graylog.elasticsearch.hosts }}
     {{- .Values.graylog.elasticsearch.hosts -}}
@jpuskar jpuskar added the bug Something isn't working label Jan 23, 2022
@KongZ
Copy link
Owner

KongZ commented Jan 23, 2022

@jpuskar thanks for reporting and patch. Can you make a PR? So we will have your name in the contributor list.

@jpuskar
Copy link
Author

jpuskar commented Jan 23, 2022

Sure thing! I will work on this later tonight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants