From 6a1f34f4f125c79f7344a87d2d97abb20bdbbbd3 Mon Sep 17 00:00:00 2001 From: Lukas Grossar Date: Thu, 29 Jun 2023 11:10:33 +0200 Subject: [PATCH] Helm: remove PVC retention policy in single-binary mode when persistence is disabled (#9805) When there are no volumeClaimTemplates configured in the StatefulSet then the Kubernetes API doesn't store the configuration for persistentVolumeClaimRetentionPolicy in turn leading to the application being constantly out of sync in e.g. Argo CD **What this PR does / why we need it**: Fixes an issue where the chart is out constantly out of sync in e.g. Argo CD **Which issue(s) this PR fixes**: **Special notes for your reviewer**: **Checklist** - [x] Reviewed the [`CONTRIBUTING.md`](https://github.com/grafana/loki/blob/main/CONTRIBUTING.md) guide (**required**) - [x] Documentation added - [ ] Tests updated - [x] `CHANGELOG.md` updated - [ ] If the change is worth mentioning in the release notes, add `add-to-release-notes` label - [x] Changes that require user attention or interaction to upgrade are documented in `docs/sources/upgrading/_index.md` - [x] For Helm chart changes bump the Helm chart version in `production/helm/loki/Chart.yaml` and update `production/helm/loki/CHANGELOG.md` and `production/helm/loki/README.md`. [Example PR](https://github.com/grafana/loki/commit/d10549e3ece02120974929894ee333d07755d213) Co-authored-by: Michel Hollands <42814411+MichelHollands@users.noreply.github.com> --- production/helm/loki/CHANGELOG.md | 5 +++++ production/helm/loki/Chart.yaml | 2 +- production/helm/loki/README.md | 2 +- .../helm/loki/templates/single-binary/statefulset.yaml | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/production/helm/loki/CHANGELOG.md b/production/helm/loki/CHANGELOG.md index cb5ea2e93e5e..207f46c6353e 100644 --- a/production/helm/loki/CHANGELOG.md +++ b/production/helm/loki/CHANGELOG.md @@ -12,6 +12,11 @@ Entries should be ordered as follows: Entries should include a reference to the pull request that introduced the change. [//]: # ( : 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.) + +## 5.8.7 + +- [BUGFIX] Remove persistentVolumeClaimRetentionPolicy from single-binary StatefulSet when persistence is disabled + ## 5.8.6 - [ENHANCEMENT] Add serviceMonitor.metricRelabelings to support metric relabelings diff --git a/production/helm/loki/Chart.yaml b/production/helm/loki/Chart.yaml index f0b2253f9410..7538606d2344 100644 --- a/production/helm/loki/Chart.yaml +++ b/production/helm/loki/Chart.yaml @@ -3,7 +3,7 @@ name: loki description: Helm chart for Grafana Loki in simple, scalable mode type: application appVersion: 2.8.2 -version: 5.8.6 +version: 5.8.7 home: https://grafana.github.io/helm-charts sources: - https://github.com/grafana/loki diff --git a/production/helm/loki/README.md b/production/helm/loki/README.md index 7fc8c2f75f15..ff18d33a864c 100644 --- a/production/helm/loki/README.md +++ b/production/helm/loki/README.md @@ -1,6 +1,6 @@ # loki -![Version: 5.8.6](https://img.shields.io/badge/Version-5.8.6-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.8.2](https://img.shields.io/badge/AppVersion-2.8.2-informational?style=flat-square) +![Version: 5.8.7](https://img.shields.io/badge/Version-5.8.7-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.8.2](https://img.shields.io/badge/AppVersion-2.8.2-informational?style=flat-square) Helm chart for Grafana Loki in simple, scalable mode diff --git a/production/helm/loki/templates/single-binary/statefulset.yaml b/production/helm/loki/templates/single-binary/statefulset.yaml index 256d2141506c..2c72e6f08fd3 100644 --- a/production/helm/loki/templates/single-binary/statefulset.yaml +++ b/production/helm/loki/templates/single-binary/statefulset.yaml @@ -24,7 +24,7 @@ spec: partition: 0 serviceName: {{ include "loki.singleBinaryFullname" . }}-headless revisionHistoryLimit: {{ .Values.loki.revisionHistoryLimit }} - {{- if and (semverCompare ">= 1.23-0" .Capabilities.KubeVersion.Version) (.Values.singleBinary.persistence.enableStatefulSetAutoDeletePVC) }} + {{- if and (semverCompare ">= 1.23-0" .Capabilities.KubeVersion.Version) (.Values.singleBinary.persistence.enableStatefulSetAutoDeletePVC) (.Values.singleBinary.persistence.enabled) }} {{/* Data on the singleBinary nodes is easy to replace, so we want to always delete PVCs to make operation easier, and will rely on re-fetching data when needed.