Skip to content

Commit

Permalink
Helm - Loki: Introduce runtimeConfig (#8179)
Browse files Browse the repository at this point in the history
  • Loading branch information
nervo authored Jan 19, 2023
1 parent 65bef5c commit 7aa5967
Show file tree
Hide file tree
Showing 12 changed files with 60 additions and 2 deletions.
9 changes: 9 additions & 0 deletions docs/sources/installation/helm/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -1794,6 +1794,15 @@ true
<td><pre lang="json">
{}
</pre>
</td>
</tr>
<tr>
<td>loki.runtimeConfig</td>
<td>object</td>
<td>Provides a reloadable runtime configuration file for some specific configuration</td>
<td><pre lang="json">
{}
</pre>
</td>
</tr>
<tr>
Expand Down
4 changes: 4 additions & 0 deletions production/helm/loki/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ Entries should be ordered as follows:

Entries should include a reference to the pull request that introduced the change.

## 4.1.1

- [FEATURE] Added `loki.runtimeConfig` helm values to provide a reloadable runtime configuration.

## 4.1

- [BUGFIX] Fix bug in provisioner job that caused the self-monitoring tenant secret to be created with an empty token.
Expand Down
2 changes: 1 addition & 1 deletion production/helm/loki/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: loki
description: Helm chart for Grafana Loki in simple, scalable mode
type: application
appVersion: 2.7.0
version: 4.3.0
version: 4.4.0
home: https://grafana.github.io/helm-charts
sources:
- https://github.com/grafana/loki
Expand Down
2 changes: 1 addition & 1 deletion production/helm/loki/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# loki

![Version: 4.3.0](https://img.shields.io/badge/Version-4.3.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.7.0](https://img.shields.io/badge/AppVersion-2.7.0-informational?style=flat-square)
![Version: 4.4.0](https://img.shields.io/badge/Version-4.4.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.7.0](https://img.shields.io/badge/AppVersion-2.7.0-informational?style=flat-square)

Helm chart for Grafana Loki in simple, scalable mode

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ spec:
volumeMounts:
- name: config
mountPath: /etc/loki/config
- name: runtime-config
mountPath: /etc/loki/runtime-config
- name: data
mountPath: /var/loki
{{- if .Values.enterprise.enabled }}
Expand Down Expand Up @@ -114,6 +116,9 @@ spec:
configMap:
name: {{ include "loki.name" . }}
{{- end }}
- name: runtime-config
configMap:
name: {{ template "loki.name" . }}-runtime
{{- if .Values.enterprise.enabled }}
- name: license
secret:
Expand Down
5 changes: 5 additions & 0 deletions production/helm/loki/templates/read/deployment-read.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ spec:
volumeMounts:
- name: config
mountPath: /etc/loki/config
- name: runtime-config
mountPath: /etc/loki/runtime-config
- name: tmp
mountPath: /tmp
- name: data
Expand Down Expand Up @@ -128,6 +130,9 @@ spec:
configMap:
name: {{ include "loki.name" . }}
{{- end }}
- name: runtime-config
configMap:
name: {{ template "loki.name" . }}-runtime
{{- if .Values.enterprise.enabled }}
- name: license
secret:
Expand Down
5 changes: 5 additions & 0 deletions production/helm/loki/templates/read/statefulset-read.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ spec:
volumeMounts:
- name: config
mountPath: /etc/loki/config
- name: runtime-config
mountPath: /etc/loki/runtime-config
- name: tmp
mountPath: /tmp
- name: data
Expand Down Expand Up @@ -137,6 +139,9 @@ spec:
configMap:
name: {{ include "loki.name" . }}
{{- end }}
- name: runtime-config
configMap:
name: {{ template "loki.name" . }}-runtime
{{- if .Values.enterprise.enabled }}
- name: license
secret:
Expand Down
9 changes: 9 additions & 0 deletions production/helm/loki/templates/runtime-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "loki.name" . }}-runtime
labels:
{{- include "loki.labels" . | nindent 4 }}
data:
runtime-config.yaml: |
{{ tpl (toYaml .Values.loki.runtimeConfig) . | nindent 4 }}
5 changes: 5 additions & 0 deletions production/helm/loki/templates/single-binary/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ spec:
mountPath: /tmp
- name: config
mountPath: /etc/loki/config
- name: runtime-config
mountPath: /etc/loki/runtime-config
{{- if .Values.singleBinary.persistence.enabled }}
- name: storage
mountPath: /var/loki
Expand Down Expand Up @@ -126,6 +128,9 @@ spec:
configMap:
name: {{ include "loki.name" . }}
{{- end }}
- name: runtime-config
configMap:
name: {{ template "loki.name" . }}-runtime
{{- if .Values.enterprise.enabled }}
- name: license
secret:
Expand Down
5 changes: 5 additions & 0 deletions production/helm/loki/templates/tokengen/job-tokengen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ spec:
mountPath: /shared
- name: config
mountPath: /etc/loki/config
- name: runtime-config
mountPath: /etc/loki/runtime-config
- name: license
mountPath: /etc/loki/license
env:
Expand Down Expand Up @@ -110,6 +112,9 @@ spec:
configMap:
name: {{ include "loki.name" . }}
{{- end }}
- name: runtime-config
configMap:
name: {{ template "loki.name" . }}-runtime
- name: license
secret:
{{- if .Values.enterprise.useExternalLicense }}
Expand Down
5 changes: 5 additions & 0 deletions production/helm/loki/templates/write/statefulset-write.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ spec:
volumeMounts:
- name: config
mountPath: /etc/loki/config
- name: runtime-config
mountPath: /etc/loki/runtime-config
- name: data
mountPath: /var/loki
{{- if .Values.enterprise.enabled }}
Expand Down Expand Up @@ -125,6 +127,9 @@ spec:
configMap:
name: {{ include "loki.name" . }}
{{- end }}
- name: runtime-config
configMap:
name: {{ template "loki.name" . }}-runtime
{{- if .Values.enterprise.enabled }}
- name: license
secret:
Expand Down
6 changes: 6 additions & 0 deletions production/helm/loki/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ loki:
{{- tpl (. | toYaml) $ | nindent 4 }}
{{- end }}
runtime_config:
file: /etc/loki/runtime-config/runtime-config.yaml
{{- with .Values.loki.memcached.chunk_cache }}
{{- if and .enabled (or .host .addresses) }}
chunk_store_config:
Expand Down Expand Up @@ -213,6 +216,9 @@ loki:
max_cache_freshness_per_query: 10m
split_queries_by_interval: 15m

# -- Provides a reloadable runtime configuration file for some specific configuration
runtimeConfig: {}

# -- Check https://grafana.com/docs/loki/latest/configuration/#common_config for more info on how to provide a common configuration
commonConfig:
path_prefix: /var/loki
Expand Down

0 comments on commit 7aa5967

Please sign in to comment.