[helm] set compactor address (#8427)

pull/8457/head
Trevor Whitney 2 years ago committed by GitHub
parent 71837194ba
commit 50af51bb36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      docs/sources/installation/helm/reference.md
  2. 1
      production/helm/loki/CHANGELOG.md
  3. 15
      production/helm/loki/templates/_helpers.tpl
  4. 1
      production/helm/loki/templates/validate.yaml
  5. 1
      production/helm/loki/values.yaml

@ -1566,6 +1566,7 @@ true
<td>Check https://grafana.com/docs/loki/latest/configuration/#common_config for more info on how to provide a common configuration</td> <td>Check https://grafana.com/docs/loki/latest/configuration/#common_config for more info on how to provide a common configuration</td>
<td><pre lang="json"> <td><pre lang="json">
{ {
"compactor_address": "{{ include \"loki.compactorAddress\" . }}",
"path_prefix": "/var/loki", "path_prefix": "/var/loki",
"replication_factor": 3 "replication_factor": 3
} }

@ -17,6 +17,7 @@ Entries should include a reference to the pull request that introduced the chang
- [BUGFIX] Fix rendering of namespace in provisioner job. - [BUGFIX] Fix rendering of namespace in provisioner job.
- [ENHANCEMENT] Allow to configure `publishNotReadyAddresses` on memberlist service. - [ENHANCEMENT] Allow to configure `publishNotReadyAddresses` on memberlist service.
- [BUGFIX] Correctly set `compactor_address` for 3 target scalable configuration.
## 4.5 ## 4.5

@ -674,3 +674,18 @@ enableServiceLinks: false
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
{{/* Determine compactor address based on target configuration */}}
{{- define "loki.compactorAddress" -}}
{{- $isSimpleScalable := eq (include "loki.deployment.isScalable" .) "true" -}}
{{- $compactorAddress := include "loki.backendFullname" . -}}
{{- if and $isSimpleScalable .Values.read.legacyReadTarget -}}
{{/* 2 target configuration */}}
{{- $compactorAddress = include "loki.readFullname" . -}}
{{- else if (not $isSimpleScalable) -}}
{{/* single binary */}}
{{- $compactorAddress = include "loki.singleBinaryFullname" . -}}
{{- end -}}
{{- printf "%s" $compactorAddress }}
{{- end }}

@ -25,4 +25,3 @@
{{- if and $isUsingFilesystem (and (eq $singleBinaryReplicas 0) $atLeastOneScalableReplica) }} {{- if and $isUsingFilesystem (and (eq $singleBinaryReplicas 0) $atLeastOneScalableReplica) }}
{{- fail "Cannot run Scalable targets (backend, read, write) without an object storage backend."}} {{- fail "Cannot run Scalable targets (backend, read, write) without an object storage backend."}}
{{- end }} {{- end }}

@ -223,6 +223,7 @@ loki:
commonConfig: commonConfig:
path_prefix: /var/loki path_prefix: /var/loki
replication_factor: 3 replication_factor: 3
compactor_address: '{{ include "loki.compactorAddress" . }}'
# -- Storage config. Providing this will automatically populate all necessary storage configs in the templated config. # -- Storage config. Providing this will automatically populate all necessary storage configs in the templated config.
storage: storage:

Loading…
Cancel
Save