Skip to content

Commit a32c31b

Browse files
authored
fix(helm): Fix persistence configuration for Memcached (grafana#14049)
* Memcached must create a file smaller than disk size * `ext_wbuf_size` must be bigger than max item size and be divisible by `wbuf_size` which is 64 by default * Add pod permissions to access local volume
1 parent 83d7eea commit a32c31b

File tree

5 files changed

+16
-6
lines changed

5 files changed

+16
-6
lines changed

production/helm/loki/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ Entries should include a reference to the pull request that introduced the chang
1313

1414
[//]: # (<AUTOMATED_UPDATES_LOCATOR> : 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.)
1515

16+
## 6.14.1
17+
18+
- [BUGFIX] Fixed Memcached persistence options.
19+
1620
## 6.14.0
1721

1822
- [FEATURE] Add additional service annotations for components in distributed mode

production/helm/loki/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: loki
33
description: Helm chart for Grafana Loki and Grafana Enterprise Logs supporting both simple, scalable and distributed modes.
44
type: application
55
appVersion: 3.1.1
6-
version: 6.14.0
6+
version: 6.14.1
77
home: https://grafana.github.io/helm-charts
88
sources:
99
- https://github.com/grafana/loki

production/helm/loki/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# loki
22

3-
![Version: 6.14.0](https://img.shields.io/badge/Version-6.14.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 3.1.1](https://img.shields.io/badge/AppVersion-3.1.1-informational?style=flat-square)
3+
![Version: 6.14.1](https://img.shields.io/badge/Version-6.14.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 3.1.1](https://img.shields.io/badge/AppVersion-3.1.1-informational?style=flat-square)
44

55
Helm chart for Grafana Loki and Grafana Enterprise Logs supporting both simple, scalable and distributed modes.
66

production/helm/loki/templates/memcached/_memcached-statefulset.tpl

+3-1
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,11 @@ spec:
102102
ports:
103103
- containerPort: {{ .port }}
104104
name: client
105+
{{- /* Calculate storage size as round(.persistence.storageSize * 0.9). But with integer built-in operators. */}}
106+
{{- $persistenceSize := (div (mul (trimSuffix "Gi" .persistence.storageSize | trimSuffix "G") 9) 10 ) }}
105107
args:
106108
- -m {{ .allocatedMemory }}
107-
- --extended=modern,track_sizes{{ if .persistence.enabled }},ext_path={{ .persistence.mountPath }}/file:{{ .persistence.storageSize }}{{ end }}{{ with .extraExtendedOptions }},{{ . }}{{ end }}
109+
- --extended=modern,track_sizes{{ if .persistence.enabled }},ext_path={{ .persistence.mountPath }}/file:{{ $persistenceSize }}G,ext_wbuf_size=16{{ end }}{{ with .extraExtendedOptions }},{{ . }}{{ end }}
108110
- -I {{ .maxItemMemory }}m
109111
- -c {{ .connectionLimit }}
110112
- -v

production/helm/loki/values.yaml

+7-3
Original file line numberDiff line numberDiff line change
@@ -2962,7 +2962,11 @@ memcached:
29622962
# -- Memcached Docker image pull policy
29632963
pullPolicy: IfNotPresent
29642964
# -- The SecurityContext override for memcached pods
2965-
podSecurityContext: {}
2965+
podSecurityContext:
2966+
runAsNonRoot: true
2967+
runAsUser: 11211
2968+
runAsGroup: 11211
2969+
fsGroup: 11211
29662970
# -- The name of the PriorityClass for memcached pods
29672971
priorityClassName: null
29682972
# -- The SecurityContext for memcached containers
@@ -3085,7 +3089,7 @@ resultsCache:
30853089
persistence:
30863090
# -- Enable creating PVCs for the results-cache
30873091
enabled: false
3088-
# -- Size of persistent disk
3092+
# -- Size of persistent disk, must be in G or Gi
30893093
storageSize: 10G
30903094
# -- Storage class to be used.
30913095
# If defined, storageClassName: <storageClass>.
@@ -3187,7 +3191,7 @@ chunksCache:
31873191
persistence:
31883192
# -- Enable creating PVCs for the chunks-cache
31893193
enabled: false
3190-
# -- Size of persistent disk
3194+
# -- Size of persistent disk, must be in G or Gi
31913195
storageSize: 10G
31923196
# -- Storage class to be used.
31933197
# If defined, storageClassName: <storageClass>.

0 commit comments

Comments
 (0)