diff --git a/docs/sources/setup/install/helm/reference.md b/docs/sources/setup/install/helm/reference.md
index 791177a961..1abe1b6560 100644
--- a/docs/sources/setup/install/helm/reference.md
+++ b/docs/sources/setup/install/helm/reference.md
@@ -1890,6 +1890,15 @@ null
[]
+ |
+
+
+ | chunksCache.addresses |
+ string |
+ Comma separated addresses list in DNS Service Discovery format |
+
+"dnssrvnoa+_memcached-client._tcp.{{ template \"loki.fullname\" $ }}-chunks-cache.{{ $.Release.Namespace }}.svc"
+
|
@@ -6282,30 +6291,6 @@ null
{}
- |
-
-
- | loki.memcached |
- object |
- 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. |
-
-{
- "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"
- }
-}
-
|
@@ -6905,6 +6890,15 @@ false
"readOnlyRootFilesystem": true
}
+
+
+
+ | memcached.enabled |
+ bool |
+ Enable the built in memcached server provided by the chart |
+
+true
+
|
@@ -10199,6 +10193,15 @@ null
[]
+ |
+
+
+ | resultsCache.addresses |
+ string |
+ Comma separated addresses list in DNS Service Discovery format |
+
+"dnssrvnoa+_memcached-client._tcp.{{ template \"loki.fullname\" $ }}-results-cache.{{ $.Release.Namespace }}.svc"
+
|
diff --git a/production/helm/loki/CHANGELOG.md b/production/helm/loki/CHANGELOG.md
index 2cdb368113..1c68bce62f 100644
--- a/production/helm/loki/CHANGELOG.md
+++ b/production/helm/loki/CHANGELOG.md
@@ -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
diff --git a/production/helm/loki/templates/chunks-cache/poddisruptionbudget-chunks-cache.yaml b/production/helm/loki/templates/chunks-cache/poddisruptionbudget-chunks-cache.yaml
index da95adf137..3404242129 100644
--- a/production/helm/loki/templates/chunks-cache/poddisruptionbudget-chunks-cache.yaml
+++ b/production/helm/loki/templates/chunks-cache/poddisruptionbudget-chunks-cache.yaml
@@ -1,4 +1,4 @@
-{{- if .Values.chunksCache.enabled }}
+{{- if and .Values.chunksCache.enabled (.Values.memcached.enabled) }}
apiVersion: {{ include "loki.pdb.apiVersion" . }}
kind: PodDisruptionBudget
metadata:
diff --git a/production/helm/loki/templates/memcached/_memcached-statefulset.tpl b/production/helm/loki/templates/memcached/_memcached-statefulset.tpl
index b0b23a02ee..0938222d53 100644
--- a/production/helm/loki/templates/memcached/_memcached-statefulset.tpl
+++ b/production/helm/loki/templates/memcached/_memcached-statefulset.tpl
@@ -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 -}}
-
diff --git a/production/helm/loki/templates/memcached/_memcached-svc.tpl b/production/helm/loki/templates/memcached/_memcached-svc.tpl
index 8574151978..3917eb444b 100644
--- a/production/helm/loki/templates/memcached/_memcached-svc.tpl
+++ b/production/helm/loki/templates/memcached/_memcached-svc.tpl
@@ -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:
diff --git a/production/helm/loki/templates/results-cache/poddisruptionbudget-results-cache.yaml b/production/helm/loki/templates/results-cache/poddisruptionbudget-results-cache.yaml
index 6bc393a87d..d7b897ff9f 100644
--- a/production/helm/loki/templates/results-cache/poddisruptionbudget-results-cache.yaml
+++ b/production/helm/loki/templates/results-cache/poddisruptionbudget-results-cache.yaml
@@ -1,4 +1,4 @@
-{{- if .Values.resultsCache.enabled }}
+{{- if and .Values.resultsCache.enabled (.Values.memcached.enabled) }}
apiVersion: {{ include "loki.pdb.apiVersion" . }}
kind: PodDisruptionBudget
metadata:
diff --git a/production/helm/loki/values.yaml b/production/helm/loki/values.yaml
index bfe7729082..38f07f1c91 100644
--- a/production/helm/loki/values.yaml
+++ b/production/helm/loki/values.yaml
@@ -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