Skip to content

feat(single-binary): delete statefulset if volumeClaimTemplates changes - #19217

Merged
JStickler merged 1 commit into
grafana:mainfrom
cwrau:feat/single-binary/delete-statefulset-on-size-change
Oct 15, 2025
Merged

feat(single-binary): delete statefulset if volumeClaimTemplates changes#19217
JStickler merged 1 commit into
grafana:mainfrom
cwrau:feat/single-binary/delete-statefulset-on-size-change

Conversation

@cwrau

@cwrau cwrau commented Sep 17, 2025

Copy link
Copy Markdown
Contributor

This makes resizing loki gitops friendly

What this PR does / why we need it:

Currently resizing loki requires manual intervention.
This PR makes it possible to resize loki without manual intervention,
by orphan-deleting the statefulset which helm then recreates.

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 17, 2025 14:08
@cwrau
cwrau force-pushed the feat/single-binary/delete-statefulset-on-size-change branch from b2dc1dd to 9e54465 Compare September 19, 2025 07:27
@cwrau

cwrau commented Sep 19, 2025

Copy link
Copy Markdown
Contributor Author

I tried running make helm-docs but it results in 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:27:27Z" level=info msg="Found Chart directories [loki]"
time="2025-09-19T07:27:27Z" level=info msg="Generating README Documentation for chart /helm-docs/production/helm/loki"
time="2025-09-19T07:27:27Z" level=warning msg="Could not open chart README file /helm-docs/production/helm/loki/README.md, skipping chart"
time="2025-09-19T07:27:28Z" level=info msg="Found Chart directories [loki]"
time="2025-09-19T07:27:28Z" level=info msg="Generating README Documentation for chart /helm-docs/production/helm/loki"
time="2025-09-19T07:27:28Z" 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
@cwrau
cwrau force-pushed the feat/single-binary/delete-statefulset-on-size-change branch from 9e54465 to 2cc495e Compare September 26, 2025 10:26
@cwrau

cwrau commented Sep 26, 2025

Copy link
Copy Markdown
Contributor Author

BUILD_IN_CONTAINER=false make helm-docs resulted in no changes

@cwrau
cwrau force-pushed the feat/single-binary/delete-statefulset-on-size-change branch from 2cc495e to 7ae4a6c Compare September 26, 2025 11:45
@pull-request-size pull-request-size Bot added size/L and removed size/M labels Sep 26, 2025

@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.

see comments

Comment thread production/helm/loki/CHANGELOG.md
@cwrau
cwrau force-pushed the feat/single-binary/delete-statefulset-on-size-change branch from 7ae4a6c to 8a4da25 Compare September 29, 2025 08:13
Comment thread production/helm/loki/CHANGELOG.md
@cwrau
cwrau force-pushed the feat/single-binary/delete-statefulset-on-size-change branch from 8a4da25 to 18dd3c0 Compare September 30, 2025 12:28

@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.

In generell, interresting feature! I may consider to integrate this at kube prometheus stack as well.

However a bit more docs are needed, since its an heavy feature.

Comment thread production/helm/loki/templates/single-binary/statefulset.yaml
Comment thread production/helm/loki/values.yaml Outdated
@cwrau
cwrau force-pushed the feat/single-binary/delete-statefulset-on-size-change branch 3 times, most recently from 9b3ac28 to 55a597e Compare October 1, 2025 08:01

@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.

LGTM

@Jayclifford345 Jayclifford345 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!

@Jayclifford345
Jayclifford345 enabled auto-merge (squash) October 15, 2025 10:31
auto-merge was automatically disabled October 15, 2025 10:38

Head branch was pushed to by a user without write access

@cwrau
cwrau force-pushed the feat/single-binary/delete-statefulset-on-size-change branch from a5e1023 to e2ad356 Compare October 15, 2025 10:38
@cwrau

cwrau commented Oct 15, 2025

Copy link
Copy Markdown
Contributor Author

Sorry, during testing I missed that the PVC needs to be patched as well 😕

@JStickler
JStickler merged commit da4240d into grafana:main Oct 15, 2025
78 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4 participants