aenix-io / etcd-operator

New generation community-driven etcd-operator!
https://etcd.aenix.io
Apache License 2.0
83 stars 14 forks source link

Enable autocompaction #222

Closed kvaps closed 3 months ago

kvaps commented 3 months ago

let's automatically enable the following options if they are not explicitly specified:

auto-compaction-mode: "periodic"
auto-compaction-retention: "5m"
snapshot-count: "10000"

The same is doing kamaji-etcd project: https://github.com/clastix/kamaji-etcd/blob/433989a4badeb8edc0925cfc671fb0cc66448e66/charts/kamaji-etcd/templates/etcd_sts.yaml#L69-L72

In Cozystack we currnelty added it into Helm chart: https://github.com/aenix-io/cozystack/pull/137/files#diff-0dcf3889fea1c88eb22a0d84208697a4ed71c8cb111d1d29ec714a71529d5822

hiddenmarten commented 3 months ago

Documentation ref: https://etcd.io/docs/v3.5/op-guide/configuration/

auto-compaction-mode: "periodic"

It is set by default, there is no need to duplicate it.

auto-compaction-retention: "5m"

We have to set it, by default, it is 0.

snapshot-count: "10000"

By default '100000', we have to override it, do it less by an order of magnitude

hiddenmarten commented 3 months ago

Just to mention:

Command-line flags take precedence over environment variables.
kvaps commented 3 months ago

Clean solution!