Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks 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 |
@@ spec.schedule @@
# batch/v1/CronJob/kube-system/etcd-defrag
! ± value change
- 0 3 * * 0
+ 0 3 * * *
|
@@ spec.values.controllers.etcd-defrag.cronjob.schedule @@
# helm.toolkit.fluxcd.io/v2/HelmRelease/kube-system/etcd-defrag
! ± value change
- 0 3 * * 0
+ 0 3 * * *
|
AI Automated ReviewAnalysis engine: omniroute@http://litellm.ai.svc.cluster.local/v1 (openai) Approve. Daily defrag schedule (
Tool Harness FindingsInspected |
|
Manual run executed (2026-09-16 ~23:50 CEST): Reconsidering "daily" — the real cost and why it's still the right cadence: Why not a slower cadence — the alert fires when in-use/total < 0.5, i.e. when free space exceeds in-use (≈238 MB, since total = in-use + free > 2·in-use):
So daily is the minimum cadence that keeps the alert quiet at this churn, and its cost is bounded (one 95 s / 100 m-CPU run per night, off-peak, 3-node cluster, 250 MB DB). The real concern isn't defrag cost — it's that we're masking the 11× post-Talos-1.14 etcd write churn (the root cause); if that churn grows further the 50 Mi rule just triggers more often. Once the churn source is found and fixed, this can drop back to weekly and the alert stops re-firing on its own. |
What
etcdDatabaseHighFragmentationRatiokeeps re-firing despite theetcd-defragCronJob running. One-line fix: defragment daily instead of weekly.Why the alert keeps coming back
etcd_mvcc_db_total_size_in_use_bytes / etcd_mvcc_db_total_size_bytes < 0.5 for 10m--auto-disalarmonly disarms etcd's own NOSPACE alarm — it does nothing for this Prometheus alert. The defrag pass is the only auto-resolution path, so it must run often enough that the ratio doesn't sink below 0.5 in betweenChange
kubernetes/apps/kube-system/etcd-defrag/app/helmrelease.yamlonly:schedule: "0 3 * * 0"→"0 3 * * *"(daily 03:00 CEST)No other flags change:
--cluster --move-leader(3 members, ~95 s total),--defrag-rule=dbQuotaUsage > 0.5 || dbSizeFree > 50Mistill triggers every run (292 MiB free), image pinned at v0.45.0 (supports etcd 3.4–3.7).Expected effect
Daily pass → ratio back to ~100 % each morning → alert auto-resolves within 10 min and stays resolved until the next day's churn accumulates (~90 MB/day ≈ 2 days of headroom before 0.5 is reached again; with daily defrag it never gets there).
Follow-up (not in this PR)
The 11× write churn itself is worth investigating separately (what started writing to etcd 11× more after the 1.14.0 rollout — new reconcile loops / chatty operator is the usual suspect). That's the root cause; this PR stops the alert noise in the meantime.
Rollback
Revert this commit — Flux re-renders the weekly schedule within the 30 m interval.