Skip to content

Commit

Permalink
fix(helm): Fix persistence configuration for Memcached (#14049)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
AndreZiviani authored Sep 25, 2024
1 parent 73d69a1 commit ee6e1cf
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 9 deletions.
11 changes: 8 additions & 3 deletions docs/sources/setup/install/helm/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -2039,7 +2039,7 @@ null
<tr>
<td>chunksCache.persistence.storageSize</td>
<td>string</td>
<td>Size of persistent disk</td>
<td>Size of persistent disk, must be in G or Gi</td>
<td><pre lang="json">
"10G"
</pre>
Expand Down Expand Up @@ -6545,7 +6545,12 @@ false
<td>object</td>
<td>The SecurityContext override for memcached pods</td>
<td><pre lang="json">
{}
{
"fsGroup": 11211,
"runAsGroup": 11211,
"runAsNonRoot": true,
"runAsUser": 11211
}
</pre>
</td>
</tr>
Expand Down Expand Up @@ -9584,7 +9589,7 @@ null
<tr>
<td>resultsCache.persistence.storageSize</td>
<td>string</td>
<td>Size of persistent disk</td>
<td>Size of persistent disk, must be in G or Gi</td>
<td><pre lang="json">
"10G"
</pre>
Expand Down
4 changes: 4 additions & 0 deletions production/helm/loki/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ Entries should include a reference to the pull request that introduced the chang

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

## 6.14.1

- [BUGFIX] Fixed Memcached persistence options.

## 6.14.0

- [FEATURE] Add additional service annotations for components in distributed mode
Expand Down
2 changes: 1 addition & 1 deletion production/helm/loki/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: loki
description: Helm chart for Grafana Loki and Grafana Enterprise Logs supporting both simple, scalable and distributed modes.
type: application
appVersion: 3.1.1
version: 6.14.0
version: 6.14.1
home: https://grafana.github.io/helm-charts
sources:
- https://github.com/grafana/loki
Expand Down
2 changes: 1 addition & 1 deletion production/helm/loki/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# loki

![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)
![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)

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,11 @@ spec:
ports:
- containerPort: {{ .port }}
name: client
{{- /* Calculate storage size as round(.persistence.storageSize * 0.9). But with integer built-in operators. */}}
{{- $persistenceSize := (div (mul (trimSuffix "Gi" .persistence.storageSize | trimSuffix "G") 9) 10 ) }}
args:
- -m {{ .allocatedMemory }}
- --extended=modern,track_sizes{{ if .persistence.enabled }},ext_path={{ .persistence.mountPath }}/file:{{ .persistence.storageSize }}{{ end }}{{ with .extraExtendedOptions }},{{ . }}{{ end }}
- --extended=modern,track_sizes{{ if .persistence.enabled }},ext_path={{ .persistence.mountPath }}/file:{{ $persistenceSize }}G,ext_wbuf_size=16{{ end }}{{ with .extraExtendedOptions }},{{ . }}{{ end }}
- -I {{ .maxItemMemory }}m
- -c {{ .connectionLimit }}
- -v
Expand Down
10 changes: 7 additions & 3 deletions production/helm/loki/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2962,7 +2962,11 @@ memcached:
# -- Memcached Docker image pull policy
pullPolicy: IfNotPresent
# -- The SecurityContext override for memcached pods
podSecurityContext: {}
podSecurityContext:
runAsNonRoot: true
runAsUser: 11211
runAsGroup: 11211
fsGroup: 11211
# -- The name of the PriorityClass for memcached pods
priorityClassName: null
# -- The SecurityContext for memcached containers
Expand Down Expand Up @@ -3085,7 +3089,7 @@ resultsCache:
persistence:
# -- Enable creating PVCs for the results-cache
enabled: false
# -- Size of persistent disk
# -- Size of persistent disk, must be in G or Gi
storageSize: 10G
# -- Storage class to be used.
# If defined, storageClassName: <storageClass>.
Expand Down Expand Up @@ -3187,7 +3191,7 @@ chunksCache:
persistence:
# -- Enable creating PVCs for the chunks-cache
enabled: false
# -- Size of persistent disk
# -- Size of persistent disk, must be in G or Gi
storageSize: 10G
# -- Storage class to be used.
# If defined, storageClassName: <storageClass>.
Expand Down

0 comments on commit ee6e1cf

Please sign in to comment.