How to Defragment etcd Without Disrupting Your Kubernetes Control Plane
etcd, the key-value store backing Kubernetes, can accumulate significant disk bloat because compaction marks pages as free but does not shrink the underlying bbolt database file. In one real-world case, a 508 MB etcd database held only 84 MB of live data, with the remainder being unused free pages. This fragmentation can cause serious issues including etcd hitting its default 2 GiB quota and going read-only, larger backup snapshots, and slower member restarts. Defragmentation rewrites the database file with only live data, reclaiming the wasted space, but must be performed carefully on self-managed clusters since managed Kubernetes providers handle it automatically. Administrators are advised to trigger defragmentation when the ratio of in-use data to total disk size drops below 50%, using etcdctl endpoint status to monitor both metrics.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in