Skip to content

docs(etcd): note that affinity is not applied to existing members - #3964

Merged
scooby87 merged 1 commit into
mainfrom
docs/etcd-affinity-not-retroactive
Sep 1, 2026
Merged

scooby87 merged 1 commit into
mainfrom
docs/etcd-affinity-not-retroactive

Conversation

@scooby87

@scooby87 scooby87 commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

What this PR does

Documentation follow-up to #3962. Both reviewers (CodeRabbit and @androndo/IvanHunters) noted that the new affinity value is not applied retroactively: the etcd-operator sets spec.affinity only when it creates or replaces a member Pod and never reschedules running members. On a cluster that already has co-located members (the exact failure #3962 targets) the default soft rule — or a newly set hard rule — takes effect only as each member is replaced.

This adds that caveat to the affinity parameter documentation in values.yaml and regenerates values.schema.json, README.md, and the embedded openAPISchema in etcd-rd. No template or behaviour change; make test passes (20/20).

The other inline note (the soft podAntiAffinity default overlaps the soft topologySpreadConstraints) was explicitly flagged as "fine to keep as-is", so no code change is made for it.

Note: this PR is stacked on fix/etcd-soft-antiaffinity (#3962) and will retarget to main once that merges.

Screenshots

n/a — no UI changes.

Downstream repositories

Doc-only change to an app chart (regenerated artifacts). No package added/renamed/removed, kind/plural unchanged, no installer values/assets/variants touched. No downstream follow-up required.

  • No downstream repository is affected by this change

Release note

NONE

Summary by CodeRabbit

  • Documentation
    • Clarified that etcd affinity rules apply when member Pods are created or replaced.
    • Noted that running members are not rescheduled retroactively; the rule takes effect as each member is replaced.
    • Updated the guidance consistently across configuration documentation and schema descriptions.

@coderabbitai

coderabbitai Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: 3471d612-ee11-48f2-9673-e4e01551927f

📥 Commits

Reviewing files that changed from the base of the PR and between edd767e and 6fdb5e0.

📒 Files selected for processing (4)
  • packages/extra/etcd/README.md
  • packages/extra/etcd/values.schema.json
  • packages/extra/etcd/values.yaml
  • packages/system/etcd-rd/cozyrds/etcd.yaml

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The Etcd affinity descriptions now state that the operator applies affinity when it creates or replaces member Pods. Running members are not rescheduled, so existing members adopt the rule only when replaced.

Changes

Etcd affinity documentation

Layer / File(s) Summary
Document affinity application timing
packages/extra/etcd/values.yaml, packages/extra/etcd/values.schema.json, packages/system/etcd-rd/cozyrds/etcd.yaml, packages/extra/etcd/README.md
The affinity comments, schema descriptions, and README entry now state that running member Pods are not rescheduled and that the rule applies as each member is replaced.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to 6fdb5

This documentation-only change clarifies when etcd affinity settings take effect without changing runtime behavior, so no actionable merge-blocking risk remains after normal checks and review.

Suggested reviewers: kvaps, androndo

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main documentation change: affinity is not applied retroactively to existing etcd members.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (4 skipped: 4 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/etcd-affinity-not-retroactive

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

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added area/database Issues or PRs related to managed databases (postgres, mariadb, redis, etcd, kafka, clickhouse) kind/documentation Categorizes issue or PR as related to documentation size/S This PR changes 10-29 lines, ignoring generated files labels Aug 26, 2026
Base automatically changed from fix/etcd-soft-antiaffinity to main August 26, 2026 11:27

@IvanHunters IvanHunters left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Docs-only change: it appends one clarifying sentence to the affinity parameter description, warning that a newly-set affinity rule is not applied retroactively to already-running etcd members and only takes effect as each member is replaced.

Two things I checked before signing off:

  • Sync across the generated artifacts. The same sentence lands identically in the source @param (packages/extra/etcd/values.yaml:26), the rendered README.md:46, values.schema.json:70, and the cozyrd openAPISchema (packages/system/etcd-rd/cozyrds/etcd.yaml). That is exactly what make generate emits from the source comment, so there is no doc drift.
  • Factual accuracy of the note. It holds by Kubernetes semantics on its own: the chart's affinity terms are all ...IgnoredDuringExecution (packages/extra/etcd/templates/etcd-cluster.yaml), so the scheduler never re-evaluates them for a running pod. Together with a quorum-aware operator that will not evict a healthy member just to satisfy affinity, the "takes effect only as each member is replaced, not retroactively" wording is correct and appropriately conservative.

No functional change and no test impact. Accurate, useful operational note.

@scooby87
scooby87 enabled auto-merge August 26, 2026 14:41
The operator applies spec.affinity only when it creates or replaces a member
Pod; it does not reschedule running members. Document that on the `affinity`
value so operators do not expect the default (or a newly set rule) to
redistribute already co-located members until each is replaced.

Addresses the non-blocking review notes on #3962.

Signed-off-by: Alexey Artamonov <[email protected]>
@scooby87
scooby87 force-pushed the docs/etcd-affinity-not-retroactive branch from 52466f4 to 6fdb5e0 Compare September 1, 2026 09:48
@scooby87
scooby87 merged commit dc2e427 into main Sep 1, 2026
18 checks passed
@scooby87
scooby87 deleted the docs/etcd-affinity-not-retroactive branch September 1, 2026 10:56
Andrei Kvapil (kvaps) pushed a commit that referenced this pull request Sep 7, 2026
)

## What this PR does

Documentation follow-up to #3962. Both reviewers (CodeRabbit and
@androndo/@IvanHunters) noted that the new `affinity` value is not
applied retroactively: the etcd-operator sets `spec.affinity` only when
it creates or replaces a member Pod and never reschedules running
members. On a cluster that already has co-located members (the exact
failure #3962 targets) the default soft rule — or a newly set hard rule
— takes effect only as each member is replaced.

This adds that caveat to the `affinity` parameter documentation in
`values.yaml` and regenerates `values.schema.json`, `README.md`, and the
embedded `openAPISchema` in `etcd-rd`. No template or behaviour change;
`make test` passes (20/20).

The other inline note (the soft podAntiAffinity default overlaps the
soft `topologySpreadConstraints`) was explicitly flagged as "fine to
keep as-is", so no code change is made for it.

> Note: this PR is stacked on `fix/etcd-soft-antiaffinity` (#3962) and
will retarget to `main` once that merges.

### Screenshots

n/a — no UI changes.

### Downstream repositories

Doc-only change to an app chart (regenerated artifacts). No package
added/renamed/removed, `kind`/`plural` unchanged, no installer
values/assets/variants touched. No downstream follow-up required.

- [x] No downstream repository is affected by this change

### Release note

```release-note
NONE
```


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Documentation**
* Clarified that etcd affinity rules apply when member Pods are created
or replaced.
* Noted that running members are not rescheduled retroactively; the rule
takes effect as each member is replaced.
* Updated the guidance consistently across configuration documentation
and schema descriptions.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/database Issues or PRs related to managed databases (postgres, mariadb, redis, etcd, kafka, clickhouse) kind/documentation Categorizes issue or PR as related to documentation size/S This PR changes 10-29 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants