-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Helm: Gateway Configuration accessability #12372
Comments
I solved my problem. But I think this could be simplified quite a bit. First for the solution:The value I want to overwrite is That value is data:
nginx.conf: |
{{- tpl .Values.gateway.nginxConfig.file . | indent 2 }} Two important points that are relevant for later are:
The default value of gateway:
nginxConfig:
file: |
{{- include "loki.nginxFile" . | indent 2 -}} So the My first approach was to replace gateway:
enabled: true
nginxConfig:
file: |
worker_processes 5; ## Default: 1
error_log /dev/stderr;
pid /tmp/nginx.pid;
worker_rlimit_nofile 8192;
.... This led to errors because of two reasons.
data:
nginx.conf: | worker_processes 5; ## Default: 1
error_log /dev/stderr;
pid /tmp/nginx.pid;
worker_rlimit_nofile 8192;
...
data:
nginx.conf: |
worker_processes 5; ## Default: 1
error_log /dev/stderr;
pid /tmp/nginx.pid;
worker_rlimit_nofile 8192;
... SolutionThe solution was to export the configuration into a separate value in and then indent that values with go templating in gateway:
enabled: true
nginxConfig:
file: |
{{- .Values.gateway.nginxConfig.myfile | indent 2 -}}
myfile: |
worker_processes 5; ## Default: 1
error_log /dev/stderr;
pid /tmp/nginx.pid;
worker_rlimit_nofile 8192;
Now to the simplification proposal:In my opinion the prefix empty line could be included into the configmap-gateway.yaml: {{- if and .Values.gateway.enabled }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "loki.gatewayFullname" . }}
namespace: {{ $.Release.Namespace }}
labels:
{{- include "loki.gatewayLabels" . | nindent 4 }}
data:
nginx.conf: |
{{ tpl .Values.gateway.nginxConfig.file . | indent 2 }}
{{- end }} _helpers.tpl: {{/* Snippet for the nginx file used by gateway */}}
{{- define "loki.nginxFile" }}
worker_processes 5; ## Default: 1
error_log /dev/stderr;
pid /tmp/nginx.pid;
worker_rlimit_nofile 8192;
events {
worker_connections 4096; ## Default: 1024
} If that'd be done overwriting the gateway configmap with the helm values would look like this: gateway:
enabled: true
nginxConfig:
file: |
worker_processes 5; ## Default: 1
error_log /dev/stderr;
pid /tmp/nginx.pid;
worker_rlimit_nofile 8192;
... That'd have spared at least me from a lot of headaches. |
Is your feature request related to a problem? Please describe.
I need two separate users for the gateway component of the HelmChart. One for ReadOnly access and another one for WriteOnly access.Therefore I need to change the
.Values.gateway.nginxConfig.file
value. But the whole configuration file is generated by a.tpl
function called.loki.nginxFile
. That configuration is dependant on multiple other variables from helm values, so I can't do minimal invasive changes to it. I'd have to overwrite the whole configuration somehow.Describe the solution you'd like
I would like the configuration to be part of the helm values.
Describe alternatives you've considered
.Values.gateway.nginxConfig.file
.Values.gateway.nginxConfig.file
values. This isn't applicable because managing static configuration for multiple loki instances would be to much overhead in the future. (With changes to the configuration, creating new loki instances in a multi cluster scenario.)_helpers.tpl
directly. This would lead to massive maintenance overhead in the long run.Additional context
I know this might be a classical case of the "Satisfy 95% of your userbase completely instead of 100% to a degree". I might be exactly in the 5% of users with exotic feature requests. But I wanted to voice my needs anyway.
If anyone here has an approach I didn't consider yet, I'd be happy to hear them. :)
The text was updated successfully, but these errors were encountered: