Skip to content

feat: add pod config drift detection - #488

Open
nwnt wants to merge 1 commit into
etcd-io:mainfrom
nwnt:update-config-on-main
Open

feat: add pod config drift detection#488
nwnt wants to merge 1 commit into
etcd-io:mainfrom
nwnt:update-config-on-main

Conversation

@nwnt

@nwnt nwnt commented Aug 31, 2026

Copy link
Copy Markdown
Member

Fix #411. Implement updateConfig config drift detection part. After detected, the controller updates the corresponding EtcdMember's phase to Recreating. The reconciliation of Recreating logic will be implemented in phase 3.

cc @ahrtr @silentred

@kubernetes-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: nwnt
Once this PR has been reviewed and has the lgtm label, please assign justinsb for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@nwnt
nwnt force-pushed the update-config-on-main branch from 76e404c to c596cca Compare August 31, 2026 06:17
Comment thread internal/controller/etcdcluster_controller.go
Comment thread internal/controller/etcdcluster_controller.go Outdated
Comment thread internal/controller/etcdcluster_controller.go Outdated
Comment thread internal/controller/etcdcluster_controller_test.go Outdated
Comment thread internal/controller/etcdcluster_controller_test.go Outdated
Comment thread internal/controller/etcdcluster_controller.go
Comment thread internal/controller/etcdcluster_controller.go Outdated
Comment thread internal/controller/etcdcluster_controller_test.go Outdated
@ahrtr

ahrtr commented Sep 2, 2026

Copy link
Copy Markdown
Member

@nwnt please resolve the review comments when you get free cycle, thx

@ahrtr

ahrtr commented Sep 2, 2026

Copy link
Copy Markdown
Member

@nwnt please resolve the review comments when you get free cycle, thx

Or I can just modify this PR directly, just let me know

@ahrtr ahrtr mentioned this pull request Sep 3, 2026

// findConfigDriftingPod finds the pod with the highest ordinal that has its config hash
// not matched with the expected hash. It returns nil when all pods match the hash.
func findConfigDriftingPod(pods []*corev1.Pod, expectedHash string) *corev1.Pod {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should update config for the leader last to avoid moving leader multiple times.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I have added the logic in updateConfig to detect and run this function again in case the first found drifting pod is the leader.

@nwnt
nwnt force-pushed the update-config-on-main branch from c596cca to 4e97369 Compare September 7, 2026 17:04
@ahrtr

ahrtr commented Sep 7, 2026

Copy link
Copy Markdown
Member

please rebase this PR

@nwnt
nwnt force-pushed the update-config-on-main branch 4 times, most recently from 2b19e20 to ae43756 Compare September 7, 2026 17:42
@nwnt

nwnt commented Sep 7, 2026

Copy link
Copy Markdown
Member Author

Done @ahrtr

@nwnt
nwnt force-pushed the update-config-on-main branch from ae43756 to 9696d94 Compare September 7, 2026 18:59
@kubernetes-prow kubernetes-prow Bot added size/XL and removed size/L labels Sep 7, 2026
@nwnt
nwnt force-pushed the update-config-on-main branch from 9696d94 to 76ec509 Compare September 7, 2026 19:05
Comment thread internal/controller/etcdcluster_controller.go Outdated
Signed-off-by: Nont <9658731+nwnt@users.noreply.github.com>
@nwnt
nwnt force-pushed the update-config-on-main branch from 76ec509 to c37d0ac Compare September 8, 2026 00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support config update

3 participants