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

How to update a default config on the loki-gateway nginx config? #10521

Open
nscriptdotgo opened this issue Sep 8, 2023 · 3 comments · May be fixed by #11348
Open

How to update a default config on the loki-gateway nginx config? #10521

nscriptdotgo opened this issue Sep 8, 2023 · 3 comments · May be fixed by #11348

Comments

@nscriptdotgo
Copy link

Hello,

I have a situation where I need to update the client_max_body_size nginx config for the loki-gateway, but I don't quite understand where I can update that in the loki helm chart, any ideas? I tried adding it in the httpSnippet variable but it does not change the existing value, only appends it. Many thanks.

@daboom
Copy link

daboom commented Oct 3, 2023

same here

@panzouh
Copy link

panzouh commented Nov 21, 2023

Same here, it would be simple to add clientMaxBodySize: 4M in nginxConfig's block. It would be interesting to add locationSnippets as well to configure keepalive or specific headers.

@asaf400
Copy link

asaf400 commented Nov 25, 2024

I'm still targeting Loki 2.X, so on Chart v5.44.4 which still has the config duplication issue without parameters,
I had to implement a workaround, when supplying chart values, basically inventing a new config value and using it:

gateway:
  nginxConfig:
    # Hack to allow for custom nginx config
    file: | 
      {{- tpl .Values.gateway.nginxConfig.custom_nginx_configfile_template . | indent 2 }}
    
    # Hack to allow for custom nginx config
    # Source from: https://github.com/grafana/loki/blob/helm-loki-5.44.4/production/helm/loki/templates/_helpers.tpl#L648
    custom_nginx_configfile_template: |

      # DO NOT REMOVE EMPTY NEWLINE ABOVE THIS LINE, IT WONT SHOW UP IN FINAL CONFIGMAP BUT IS REQUIRED FOR TEMPLATING
      worker_processes  5;  ## Default: 1
      <.. Rest of config here, with ability for user to modify..>

The upside is that I'm still using official chart source, and no chart modification is required, just values..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment