Skip to content

--disable-etcd on an existing etcd server does not remove its etcd member #14800

Closed

Description

@spicysharkco

Environmental Info:
K3s Version: observed on v1.35.4+k3s1; the code path below is unchanged in v1.37.1+k3s1

Node(s) CPU architecture, OS, and Version: x86_64, Debian GNU/Linux 13 (trixie)

Cluster Configuration: 3 servers with embedded etcd, converted to 1 etcd server plus 2 control-plane-only servers (disable-etcd: true)

Describe the bug:
Restarting an existing embedded-etcd server with --disable-etcd stops its etcd and clears its node-role.kubernetes.io/etcd label, but the node stays in the etcd member list. The remaining members keep counting it toward quorum. A check based on the node label reports the conversion as done while the member list is unchanged.

Steps To Reproduce:

  • Installed K3s: 3 servers in an embedded-etcd HA cluster, all three etcd members healthy
  • On server 2, add disable-etcd: true to /etc/rancher/k3s/config.yaml and run systemctl restart k3s.
  • After about 15 s, kubectl get node -l node-role.kubernetes.io/etcd=true lists servers 1 and 3 only.
  • On server 1, run etcdctl member list with the certs in /var/lib/rancher/k3s/server/tls/etcd/.

Expected behavior:
Server 2 is removed from the etcd member list, which is what the // remove etcd member if it exists call in startEtcdProxy (pkg/cluster/cluster.go) intends.

Actual behavior:
etcdctl member list still shows 3 members. The surviving members log failed to reach the peer URL for server 2's member ID without stopping (we left it for 27 minutes). Server 2's /var/lib/rancher/k3s/server/db/etcd no longer exists afterwards. Doing the same on server 3 would leave 2 of 3 members down and lose quorum. Removing the member by hand (etcd.k3s.cattle.io/remove=true annotation or etcdctl member remove) works.

Additional context / logs:
Code references are to v1.37.1+k3s1:

One possible fix: in RemoveSelf, when e.name is empty, read the existing nameFile before the rename and use that name for RemovePeer.

The observations come from the commands listed above, run on v1.35.4+k3s1. The code path was checked by reading the v1.37.1+k3s1 source, not by a rerun.

Activity

  1. brandond commented on Oct 14, 2026

    @brandond
    Member

    PR welcome. Preferably with a docker based e2e test, NOT a go test as Claude likes to generate.

  2. moved this from To Triage to Done Issue in K3s Developmenton Oct 14, 2026
  3. moved this from Done Issue to To Test in K3s Developmenton Oct 20, 2026
  4. self-assigned this
    on Oct 20, 2026
  5. self-assigned this
    on Oct 20, 2026
  6. aganesh-suse commented on Oct 23, 2026

    @aganesh-suse

    Closing based on: #14865

  7. moved this from To Test to Done Issue in K3s Developmenton Oct 23, 2026
  8. spicysharkco commented on Oct 23, 2026

    @spicysharkco
    ContributorAuthor

    A correction to the issue text: the etcd.k3s.cattle.io/remove=true annotation does not remove the member once the restart has cleared the node's etcd role label, as the reproduction in #14865 also found. The member controller skips nodes without that label in both sync and onRemove, so deleting the node does not remove the member either. etcdctl member remove works.

    A server converted before upgrading to a release with the fix keeps its stale member. The earlier restart already moved db/etcd, including its name file, to db/etcd-old-<timestamp>, and RemoveSelf now reads only db/etcd/name. For those clusters etcdctl member remove is still needed.

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

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions