chore(base-cluster/logs): only delete volumes on deletion#1721
Conversation
chore(base-cluster/logs): optimize volume chown; this speeds up startup
There was a problem hiding this comment.
Pull Request Overview
This PR optimizes Loki startup performance by updating the Loki Helm chart version and configuring volume ownership handling to only perform expensive operations when necessary.
- Updated Loki Helm chart from version 6.33.0 to 6.42.0
- Added
fsGroupChangePolicy: OnRootMismatchto avoid unnecessary chown operations on startup - Configured persistence policy to retain volumes when scaling but delete when the deployment is removed
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| charts/base-cluster/values.yaml | Updates Loki chart version to 6.42.0 |
| charts/base-cluster/templates/monitoring/logs/loki.yaml | Adds volume ownership optimization and persistence policies |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
WalkthroughUpdated Loki Helm template to add podSecurityContext fsGroupChangePolicy and persistence lifecycle hooks. Bumped Grafana Loki chart version in values.yaml from 6.33.0 to 6.42.0. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Dev as Helm (values.yaml)
participant K8s as Kubernetes API
participant STS as StatefulSet/PVC
participant Loki as Loki Pod
rect rgb(230,245,255)
note over Dev: Upgrade Loki chart 6.33.0 ➜ 6.42.0
Dev->>K8s: helm upgrade --values values.yaml
end
K8s->>STS: Reconcile StatefulSet & PVC
STS-->>Loki: Create/Update Pod
rect rgb(235,255,235)
note over Loki: podSecurityContext.fsGroupChangePolicy=OnRootMismatch
Loki->>Loki: Apply fsGroup adjustments on root mismatch
end
alt Scale event
note over STS: Persistence whenScaled=Retain
STS->>STS: Keep PVCs during scaling
else Deletion
note over STS: Persistence whenDeleted=Delete
STS->>K8s: Delete PVCs on resource deletion
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
charts/base-cluster/templates/monitoring/logs/loki.yaml(2 hunks)charts/base-cluster/values.yaml(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: check licenses
- GitHub Check: Update release-please config file for a possibly new chart
- GitHub Check: lint helm chart (base-cluster)
🔇 Additional comments (1)
charts/base-cluster/values.yaml (1)
112-112: Approve Loki chart bump; retention policy & fsGroup confirmed.6.42.0 supports
singleBinary.persistence.enableStatefulSetAutoDeletePVCfor emittingwhenDeleted/whenScaled; defaultpodSecurityContext.fsGroupremains10001.
🤖 I have created a release *beep* *boop* --- ## [10.0.0](base-cluster-v9.4.0...base-cluster-v10.0.0) (2025-10-23) ### ⚠ BREAKING CHANGES * **base-cluster/backup:** add k8up provider ([#1751](#1751)) ### Features * **base-cluster/backup:** add k8up provider ([#1751](#1751)) ([0f36225](0f36225)) ### Bug Fixes * **base-cluster/kyverno:** change kubectl image ([#1734](#1734)) ([cb42f26](cb42f26)) * **base-cluster:** conditions must the `true`, not just truthy ([#1738](#1738)) ([7f46f4e](7f46f4e)) * **base-cluster:** migrate promtail leftovers to alloy ([#1720](#1720)) ([8b7d062](8b7d062)) ### Miscellaneous Chores * **base-cluster/external-dns:** migrate domainFilters syntax ([#1681](#1681)) ([51a42a2](51a42a2)) * **base-cluster/kdave:** remove kdave ([#1724](#1724)) ([723c049](723c049)) * **base-cluster/logs:** only delete volumes on deletion ([#1721](#1721)) ([36b657a](36b657a)) * **base-cluster/logs:** optimize volume chown; this speeds up startup ([36b657a](36b657a)) * **base-cluster/traces:** delete tempo volumes on deletion ([#1722](#1722)) ([0afce96](0afce96)) * **base-cluster:** use upstream kubectl image instead of rancher ([#1718](#1718)) ([d4daf94](d4daf94)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes - Version 10.0.0 * **Breaking Changes** * base-cluster/backup provider modifications require attention during upgrade. * **New Features** * base-cluster/backup enhancements. * **Bug Fixes** * Kyverno configuration improvements. * kubectl image handling optimizations. * Boolean condition evaluation corrections. * Promtail migration cleanup. * Tempo volume deletion fixes. * **Chores** * Infrastructure syntax and dependency updates. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
chore(base-cluster/logs): optimize volume chown; this speeds up startup
Summary by CodeRabbit