Skip to content

docs(etcd-per-cluster): match the implementation - #141

Open
Timofei Larkin (lllamnyp) wants to merge 1 commit into
proposal/etcd-per-clusterfrom
docs/etcd-per-cluster-reconcile
Open

Timofei Larkin (lllamnyp) wants to merge 1 commit into
proposal/etcd-per-clusterfrom
docs/etcd-per-cluster-reconcile

Conversation

@lllamnyp

Copy link
Copy Markdown
Member

Reconciles the per-cluster etcd proposal (#25) with what cozystack/cozystack#4817 shipped. That PR implemented phases 1 and 2 and departed from the proposal in several places; this brings the design back in line with the code, as Aleksei Sviridkin (@lexfrei)'s review asks. It targets proposal/etcd-per-cluster, so it can be folded into #25.

What changed

Each point of lexfrei's review, and where it now lands:

  1. _namespace.etcd can't tell an existing cluster from a new one. Design §4 decides from the live KamajiControlPlane's spec.dataStoreName, as #4817 does. Context and the first problem story now say that every tenant resolves _namespace.etcd to at least tenant-root, and that a new cluster pointed at a DataStore/tenant-root that may not exist. Decision record 0001.
  2. <namespace>-<release> collides. Design §3 names the DataStore <namespace>.<release>, capped at 63 characters with a hash.
  3. No platform backup. Design §7: the Kubernetes backup strategy (cozystack#4931) covers a cluster's own etcd, and its dump Job carries the label the policy admits.
  4. The network-policy claim doesn't hold. Design §5 and Security describe the CiliumNetworkPolicy with ingressDeny that #4817 ships. Decision record 0002.
  5. Phase 4 would switch off every addon. The _namespace.etcd gates went in Phase 2 (Design §4, Rollout), so Phase 4 no longer depends on them.
  6. SerjioTT's live-switch run. The runbook gains the reachability pre-flight from the cluster's namespace, the leftover migrate-Job check, a canary write instead of a read, the kamaji-freeze cleanup, and the rolling kubelet restart with the missing Talos access. The operator talosconfig is an open question.
  • Smaller points: no truncate-and-hash for the etcd name (the app name is capped at 32, the ceiling is 56 because of <cluster>-client); the names table includes the client Service and the CA Secret; cozystack.kubernetes-application depends on cozystack.etcd-operator (§7); the revision note, the review-round references and the stale migration slot are gone.

Other changes that follow from #4817:

  • etcd.replicas is bounded by the schema to 1..3 and 2 is refused at render, rather than a schema enum, and the StorageClass is fixed at creation with a refused 3 → 1 drop on local storage (§2).
  • Deletion releases Kamaji's finalizer on a cluster's own etcd and fails closed before the PKI goes (§6). Decision record 0003.
  • The report-only platform migration exists (migration 63 → 64), and Testing and Rollout say what shipped, what is covered, and what is not yet.
  • The Status and Date fields go, per the current proposal template. A Decisions section and three records under decisions/ are added.
  • New Open questions: how an operator opts a cluster into migration, an operator talosconfig, and alert rules for a cluster's own etcd. The opt-in migration moves from Phase 2 to Phase 3, since #4817 shipped without it.

Not changed here

  • The commit squash and the commit-trailer and subject changes lexfrei asked for on [proposal] Per-cluster etcd: give each Kubernetes control plane its own datastore #25's two existing commits. Those rewrite this branch's history, so they are for myasnikovdaniil to do when folding this in.
  • The Author(s) field.
  • Two of androndo's points on cozystack#4817 that are still open: the uninstall timing and a cluster whose KamajiControlPlane is missing at render time. They are recorded as consequences in records 0001 and 0003, not as resolved.

Before review

DCO

  • Commits are signed off (git commit --signoff).

cozystack/cozystack#4817 implemented phases 1 and 2 and had to depart
from this proposal where the proposal's facts were wrong:
_namespace.etcd is never empty, so it cannot tell a new cluster from an
existing one; a dashed DataStore name collides across nested tenants;
retargeting an allow label cannot narrow what the tenant's policies
already admit; and Kamaji's finalizer cannot complete against an etcd
that is down. Left as written, the accepted design and the code would
disagree from the start.

The proposal now describes what shipped, folds the live-switch
findings into the migration runbook, records the remaining work as
phases 3 and 4 and open questions, and drops the Status and Date
fields the proposal template no longer carries. The three reversals
of the proposal's own design get decision records, since the code
explains the mechanism but not the option that lost.

Assisted-by: LLM
Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d536003e-67cc-4dc5-bc73-00cb65da7caa
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant