diff --git a/docs/sources/setup/install/helm/reference.md b/docs/sources/setup/install/helm/reference.md index f61cba39da..999c4ff83d 100644 --- a/docs/sources/setup/install/helm/reference.md +++ b/docs/sources/setup/install/helm/reference.md @@ -11142,6 +11142,15 @@ true
 "/rules"
 
+ + + + sidecar.rules.folderAnnotation + string + The annotation overwriting the folder value. The annotation value can be either an absolute or a relative path. Relative paths will be relative to FOLDER. Useful for multi-tenancy setups. +
+null
+
diff --git a/production/helm/loki/CHANGELOG.md b/production/helm/loki/CHANGELOG.md index 4074a85be7..e19413ba9d 100644 --- a/production/helm/loki/CHANGELOG.md +++ b/production/helm/loki/CHANGELOG.md @@ -14,6 +14,7 @@ Entries should include a reference to the pull request that introduced the chang [//]: # ( : do not remove this line. This locator is used by the CI pipeline to automatically create a changelog entry for each new Loki release. Add other chart versions and respective changelog entries bellow this line.) - [BUGFIX] Move loki-sc-rules container from first location in `containers` to second to avoid it being selected as the default for `kubectl logs` or `kubectl exec` +- [ENHANCEMENT] Add FOLDER_ANNOTATATION logic for sidecar container. [#13289](https://github.com/grafana/loki/pull/13289) ## 6.32.0 diff --git a/production/helm/loki/templates/backend/statefulset-backend.yaml b/production/helm/loki/templates/backend/statefulset-backend.yaml index 40decdb149..6b5e5c943e 100644 --- a/production/helm/loki/templates/backend/statefulset-backend.yaml +++ b/production/helm/loki/templates/backend/statefulset-backend.yaml @@ -149,6 +149,10 @@ spec: {{- end }} - name: FOLDER value: "{{ .Values.sidecar.rules.folder }}" + {{- if .Values.sidecar.rules.folderAnnotation }} + - name: FOLDER_ANNOTATION + value: "{{ .Values.sidecar.rules.folderAnnotation }}" + {{- end }} - name: RESOURCE value: {{ quote .Values.sidecar.rules.resource }} {{- if .Values.sidecar.enableUniqueFilenames }} diff --git a/production/helm/loki/values.yaml b/production/helm/loki/values.yaml index 327b63ea6f..b735b5e48e 100644 --- a/production/helm/loki/values.yaml +++ b/production/helm/loki/values.yaml @@ -3622,6 +3622,10 @@ sidecar: labelValue: "" # -- Folder into which the rules will be placed. folder: /rules + # -- The annotation overwriting the folder value. + # The annotation value can be either an absolute or a relative path. Relative paths will be relative to FOLDER. + # Useful for multi-tenancy setups. + folderAnnotation: null # -- Comma separated list of namespaces. If specified, the sidecar will search for config-maps/secrets inside these namespaces. # Otherwise the namespace in which the sidecar is running will be used. # It's also possible to specify 'ALL' to search in all namespaces.