Skip to content

feat(helm): Only delete PVC on statefulset deletion, not scaling - #19097

Merged
nicolevanderhoeven merged 4 commits into
grafana:mainfrom
cwrau:feat/single-binary/only-delete-on-deletion
Oct 1, 2025
Merged

feat(helm): Only delete PVC on statefulset deletion, not scaling#19097
nicolevanderhoeven merged 4 commits into
grafana:mainfrom
cwrau:feat/single-binary/only-delete-on-deletion

Conversation

@cwrau

@cwrau cwrau commented Sep 3, 2025

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

Users using the single binary deployment mode don't want to lose their data during scaling (to zero)

Which issue(s) this PR fixes:

Special notes for your reviewer:

Checklist

  • Reviewed the CONTRIBUTING.md guide (required)
  • Documentation added
  • Tests updated
  • Title matches the required conventional commits format, see here
    • Note that Promtail is considered to be feature complete, and future development for logs collection will be in Grafana Alloy. As such, feat PRs are unlikely to be accepted unless a case can be made for the feature actually being a bug fix to existing behavior.
  • Changes that require user attention or interaction to upgrade are documented in docs/sources/setup/upgrade/_index.md
  • If the change is deprecating or removing a configuration option, update the deprecated-config.yaml and deleted-config.yaml files respectively in the tools/deprecated-config-checker directory. Example PR
@cwrau
cwrau requested a review from a team as a code owner September 3, 2025 08:12
@CLAassistant

CLAassistant commented Sep 3, 2025

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@cwrau
cwrau force-pushed the feat/single-binary/only-delete-on-deletion branch from d2081a0 to 3583f9b Compare September 3, 2025 08:12
@JStickler JStickler changed the title feat(single-binary): Only delete PVC on statefulset deletion, not scaling Sep 3, 2025
@cwrau

cwrau commented Sep 17, 2025

Copy link
Copy Markdown
Contributor Author

Heyho, is there something I can do to help get this merged?

Comment thread production/helm/loki/templates/single-binary/statefulset.yaml Outdated

@jkroepke jkroepke left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and please add a note to the CHANGELOG

@cwrau
cwrau force-pushed the feat/single-binary/only-delete-on-deletion branch from 3583f9b to 899ffb8 Compare September 19, 2025 07:34
@cwrau

cwrau commented Sep 19, 2025

Copy link
Copy Markdown
Contributor Author

I tried running make helm-docs but it returned the following error;

make -BC docs sources/setup/install/helm/reference.md
make[1]: Entering directory '/home/cwr/projects/loki/docs'
podman run --rm --volume "/home/cwr/projects/loki:/helm-docs" -u "$(id -u)" "docker.io/jnorwood/helm-docs:v1.11.0" \
	-c /helm-docs/production/helm/ \
	-t reference.md.gotmpl \
	-o reference.md
podman run --rm --volume "/home/cwr/projects/loki:/helm-docs" -u "$(id -u)" "docker.io/jnorwood/helm-docs:v1.11.0" \
	-c /helm-docs/production/helm/ \
	-t README.md.gotmpl \
	-o README.md
mv "../production/helm/loki/reference.md" "sources/setup/install/helm/reference.md"
time="2025-09-19T07:32:22Z" level=info msg="Found Chart directories [loki]"
time="2025-09-19T07:32:22Z" level=info msg="Generating README Documentation for chart /helm-docs/production/helm/loki"
time="2025-09-19T07:32:22Z" level=warning msg="Could not open chart README file /helm-docs/production/helm/loki/README.md, skipping chart"
time="2025-09-19T07:32:23Z" level=info msg="Found Chart directories [loki]"
time="2025-09-19T07:32:23Z" level=info msg="Generating README Documentation for chart /helm-docs/production/helm/loki"
time="2025-09-19T07:32:23Z" level=warning msg="Could not open chart README file /helm-docs/production/helm/loki/README.md, skipping chart"
mv: cannot stat '../production/helm/loki/reference.md': No such file or directory
make[1]: *** [Makefile:16: sources/setup/install/helm/reference.md] Error 1
make[1]: Leaving directory '/home/cwr/projects/loki/docs'
make: *** [Makefile:260: helm-docs] Error 2
@jkroepke

jkroepke commented Sep 19, 2025

Copy link
Copy Markdown
Contributor

Maybe the podman integration is broken. It seems volume permissions are not respected?

Comment thread production/helm/loki/templates/single-binary/statefulset.yaml Outdated
@cwrau
cwrau force-pushed the feat/single-binary/only-delete-on-deletion branch from 899ffb8 to 116101a Compare September 23, 2025 07:45
@cwrau

cwrau commented Sep 23, 2025

Copy link
Copy Markdown
Contributor Author

Maybe the podman integration is broken. It seems volume permissions are not respected?

I have no Idea, but BUILD_IN_CONTAINER=false make helm-docs worked after I installed helm-docs 👍

@jkroepke

Copy link
Copy Markdown
Contributor

LGTM

@cwrau
cwrau force-pushed the feat/single-binary/only-delete-on-deletion branch from 116101a to fbb2c52 Compare September 26, 2025 10:23
Comment thread production/helm/loki/CHANGELOG.md Outdated
@cwrau
cwrau force-pushed the feat/single-binary/only-delete-on-deletion branch from fbb2c52 to 13b1d5e Compare September 29, 2025 08:14
@pull-request-size pull-request-size Bot added size/M and removed size/S labels Sep 29, 2025
@nicolevanderhoeven
nicolevanderhoeven enabled auto-merge (squash) October 1, 2025 20:47

@nicolevanderhoeven nicolevanderhoeven left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nicolevanderhoeven
nicolevanderhoeven merged commit 0cead58 into grafana:main Oct 1, 2025
78 checks passed
felix0102 pushed a commit to felix0102/loki that referenced this pull request Aug 2, 2026
…fana#19097)

Co-authored-by: nicolevanderhoeven <36070553+nicolevanderhoeven@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4 participants