feat(helm): allow external memcached setup (#17432)

Co-authored-by: J Stickler <julie.stickler@grafana.com>
pull/18360/head^2
Abder 6 months ago committed by GitHub
parent eb1e039624
commit 013aa17716
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 51
      docs/sources/setup/install/helm/reference.md
  2. 7
      production/helm/loki/CHANGELOG.md
  3. 2
      production/helm/loki/templates/chunks-cache/poddisruptionbudget-chunks-cache.yaml
  4. 3
      production/helm/loki/templates/memcached/_memcached-statefulset.tpl
  5. 2
      production/helm/loki/templates/memcached/_memcached-svc.tpl
  6. 2
      production/helm/loki/templates/results-cache/poddisruptionbudget-results-cache.yaml
  7. 26
      production/helm/loki/values.yaml

@ -1890,6 +1890,15 @@ null
<td><pre lang="json">
[]
</pre>
</td>
</tr>
<tr>
<td>chunksCache.addresses</td>
<td>string</td>
<td>Comma separated addresses list in DNS Service Discovery format</td>
<td><pre lang="json">
"dnssrvnoa+_memcached-client._tcp.{{ template \"loki.fullname\" $ }}-chunks-cache.{{ $.Release.Namespace }}.svc"
</pre>
</td>
</tr>
<tr>
@ -6282,30 +6291,6 @@ null
<td><pre lang="json">
{}
</pre>
</td>
</tr>
<tr>
<td>loki.memcached</td>
<td>object</td>
<td>Configure memcached as an external cache for chunk and results cache. Disabled by default must enable and specify a host for each cache you would like to use.</td>
<td><pre lang="json">
{
"chunk_cache": {
"batch_size": 256,
"enabled": false,
"host": "",
"parallelism": 10,
"service": "memcached-client"
},
"results_cache": {
"default_validity": "12h",
"enabled": false,
"host": "",
"service": "memcached-client",
"timeout": "500ms"
}
}
</pre>
</td>
</tr>
<tr>
@ -6905,6 +6890,15 @@ false
"readOnlyRootFilesystem": true
}
</pre>
</td>
</tr>
<tr>
<td>memcached.enabled</td>
<td>bool</td>
<td>Enable the built in memcached server provided by the chart</td>
<td><pre lang="json">
true
</pre>
</td>
</tr>
<tr>
@ -10199,6 +10193,15 @@ null
<td><pre lang="json">
[]
</pre>
</td>
</tr>
<tr>
<td>resultsCache.addresses</td>
<td>string</td>
<td>Comma separated addresses list in DNS Service Discovery format</td>
<td><pre lang="json">
"dnssrvnoa+_memcached-client._tcp.{{ template \"loki.fullname\" $ }}-results-cache.{{ $.Release.Namespace }}.svc"
</pre>
</td>
</tr>
<tr>

@ -29,6 +29,13 @@ Entries should include a reference to the pull request that introduced the chang
- [BUGFIX] Ensure global.extraEnv and global.extraEnvFrom applied to all resources consistently ([#16828](https://github.com/grafana/loki/pull/16828))
- [BUGFIX] Fixed statement logic to enable annotations for deployment-gateway, deployment-read, and statefulset-write
- [BUGFIX] Fix `extraArgs`, `extraVolumes`, `extraVolumeMounts` global values.
- [FEATURE] Add config support for external memcache cluster by setting the following config:
memcached:
enabled: false # <- setting false here
resultsCache:
addresses: 'my-resultsCache-memcached-address' # <- setting results cache address here
chunksCache:
addresses: 'my-chunksCache-memcached-address' # <- setting chunks cache address here
## 6.29.0

@ -1,4 +1,4 @@
{{- if .Values.chunksCache.enabled }}
{{- if and .Values.chunksCache.enabled (.Values.memcached.enabled) }}
apiVersion: {{ include "loki.pdb.apiVersion" . }}
kind: PodDisruptionBudget
metadata:

@ -8,7 +8,7 @@ valuesSection and component are specified separately because helm prefers camelc
*/}}
{{- define "loki.memcached.statefulSet" -}}
{{ with (index $.ctx.Values $.valuesSection) }}
{{- if .enabled -}}
{{- if and .enabled ($.ctx.Values.memcached.enabled) -}}
apiVersion: apps/v1
kind: StatefulSet
metadata:
@ -181,4 +181,3 @@ spec:
{{- end -}}
{{- end -}}
{{- end -}}

@ -8,7 +8,7 @@ valuesSection and component are specified separately because helm prefers camelc
*/}}
{{- define "loki.memcached.service" -}}
{{ with (index $.ctx.Values $.valuesSection) }}
{{- if .enabled -}}
{{- if and .enabled ($.ctx.Values.memcached.enabled) -}}
apiVersion: v1
kind: Service
metadata:

@ -1,4 +1,4 @@
{{- if .Values.resultsCache.enabled }}
{{- if and .Values.resultsCache.enabled (.Values.memcached.enabled) }}
apiVersion: {{ include "loki.pdb.apiVersion" . }}
kind: PodDisruptionBudget
metadata:

@ -212,7 +212,7 @@ loki:
batch_size: {{ .batchSize }}
parallelism: {{ .parallelism }}
memcached_client:
addresses: dnssrvnoa+_memcached-client._tcp.{{ template "loki.fullname" $ }}-chunks-cache.{{ $.Release.Namespace }}.svc
addresses: {{ .addresses }}
consistent_hash: true
timeout: {{ .timeout }}
max_idle_conns: 72
@ -260,8 +260,8 @@ loki:
writeback_buffer: {{ .writebackBuffer }}
writeback_size_limit: {{ .writebackSizeLimit }}
memcached_client:
addresses: {{ .addresses }}
consistent_hash: true
addresses: dnssrvnoa+_memcached-client._tcp.{{ template "loki.fullname" $ }}-results-cache.{{ $.Release.Namespace }}.svc
timeout: {{ .timeout }}
update_interval: 1m
{{- end }}
@ -462,21 +462,6 @@ loki:
# Optional storage account key
account_key: null
# -- Configure memcached as an external cache for chunk and results cache. Disabled by default
# must enable and specify a host for each cache you would like to use.
memcached:
chunk_cache:
enabled: false
host: ""
service: "memcached-client"
batch_size: 256
parallelism: 10
results_cache:
enabled: false
host: ""
service: "memcached-client"
timeout: "500ms"
default_validity: "12h"
# -- Check https://grafana.com/docs/loki/latest/configuration/#schema_config for more info on how to configure schemas
schemaConfig: {}
# -- a real Loki install requires a proper schemaConfig defined above this, however for testing or playing around
@ -3205,7 +3190,10 @@ overridesExporter:
appProtocol:
grpc: ""
# You can use a self hosted memcached by setting enabled to false and providing addresses.
memcached:
# -- Enable the built in memcached server provided by the chart
enabled: true
image:
# -- Memcached Docker image repository
repository: memcached
@ -3264,6 +3252,8 @@ memcachedExporter:
resultsCache:
# -- Specifies whether memcached based results-cache should be enabled
enabled: true
# -- Comma separated addresses list in DNS Service Discovery format
addresses: dnssrvnoa+_memcached-client._tcp.{{ template "loki.fullname" $ }}-results-cache.{{ $.Release.Namespace }}.svc
# -- Specify how long cached results should be stored in the results-cache before being expired
defaultValidity: 12h
# -- Memcached operation timeout
@ -3362,6 +3352,8 @@ resultsCache:
chunksCache:
# -- Specifies whether memcached based chunks-cache should be enabled
enabled: true
# -- Comma separated addresses list in DNS Service Discovery format
addresses: dnssrvnoa+_memcached-client._tcp.{{ template "loki.fullname" $ }}-chunks-cache.{{ $.Release.Namespace }}.svc
# -- Batchsize for sending and receiving chunks from chunks cache
batchSize: 4
# -- Parallel threads for sending and receiving chunks from chunks cache

Loading…
Cancel
Save