Repository navigation
feat(kubernetes): expose only etcd.replicas to users, keep per-cluster etcd sizing internal #3179
Description
Context
Design proposal cozystack/community#25 folds etcd into the kubernetes app (one etcd per cluster). As part of that work, the app will gain a new etcd values block. The proposal's draft exposes the full block to users:
etcd:
replicas: 3
size: 4Gi
storageClass: ""
resources:
cpu: 1000m
memory: 512MiThis issue tracks a scoped design decision raised in review by Sergei Makarov (@SerjioTT) (comment): keep the user-facing etcd surface minimal — expose only replicas — and treat everything else as a control-plane implementation detail.
Problem
Per-cluster etcd is cluster infrastructure, not a user surface. The kubernetes chart already has a clear convention for this split:
- Control plane (apiserver / cm / scheduler / konnectivity) — tunable via
controlPlane.*.resourcesPreset. - Infrastructure satellites (
kccm,cluster-autoscaler,kcsi-controller) — resources are hardcoded, not exposed through values, and there are no field reports of anyone needing to tune them.
Exposing a full {replicas, size, storageClass, resources} block for etcd would break this convention and add UX complexity for knobs users don't need to turn. resourcePresets for the 4 CP components are already hard enough to reason about.
Proposal
Expose a single knob:
## @param {Etcd} etcd - Control-plane etcd datastore for this cluster.
etcd:
## @field {int} replicas=3 - etcd replicas. 3 = HA (Raft quorum). 1 = non-HA/dev.
replicas: 3Everything else becomes chart-internal:
resources— hardcoded to the currentpackages/extra/etcddefault (cpu: 1000m, memory: 512Mi); VPA handles growth (same pattern already used for the satellites).size— hardcoded to4Gi(matches current behaviour; ample headroom for a Kamaji datastore).storageClass— derived fromreplicas, not set by the user:replicas: 3→ local-style SC (etcd replicates via Raft),replicas: 1→ replicated/DRBD-style SC (single member gets storage-layer HA as a safety net).- The SC mapping should be platform-level config, not app-level — e.g. via
cozystack-values(default-etcd-sc-local/default-etcd-sc-replicated), with thekubernetesapp just picking between them byetcd.replicas.
Why not the full block
- Matches the existing satellite convention (hardcoded infra resources + VPA).
- Keeps the
KubernetesCR simple — no new tuning surface users didn't ask for. - Forward-compatible: the minimal API is a strict subset of the full block. If a real production need to override
resources/size/storageClassshows up later, the API can be widened with no breaking change.
Notes
- Default
replicas: 3(safe-by-default HA); dev/throwaway clusters flip to1explicitly. - Surface the etcd footprint in
NOTES.txtso consumers see the full per-cluster cost (~1000m/512Mi × replicas).
Dependencies
- Depends on the per-cluster etcd refactor from [proposal] Per-cluster etcd: give each Kubernetes control plane its own datastore community#25 — there is nothing to expose/hide until etcd is folded into the
kubernetesapp.
Activity
lexfrei commentedon Sep 23, 2026
The design question is already in cozystack/community#25, so the decision should happen there. This issue stays open to track the implementation.