Skip to content

Commit 2932ecc

Browse files
committed
fix(etcd): keep legacy etcd-headless Service alive during v1alpha2 adoption
etcd-migrate adopts legacy clusters IN PLACE, so the Pods keep their original spec.subdomain: etcd-headless and are dialed at etcd-<i>.etcd-headless.<ns>.svc until they eventually roll onto the operator's native <member>.etcd.<ns>.svc domain. The v1alpha2 operator only creates the native `etcd` Service, and the legacy `etcd-headless` Service is pruned during the transition, so those names stop resolving (no such host), the operator's MemberList fails, and status.readyMembers never populates -- the EtcdCluster never goes Ready even though the etcd processes are healthy and in quorum. Ship a chart-managed transitional headless `etcd-headless` Service (selector mirrors the operator's native `etcd` Service via etcd-operator.cozystack.io/cluster, publishNotReadyAddresses: true). This is the DNS counterpart of the legacy *.etcd-headless.<ns>.svc wildcard already kept in the server/peer cert SANs for the same transition window -- the TLS half of the compat was done, the DNS half was missing. Safe to remove, together with that SAN, once the members have rolled onto the native `etcd` subdomain. Verified live: recreating this Service on an adopted 3-node cluster restored per-pod DNS and the cluster went readyMembers=3 / Available=True. Refs: #3243 Signed-off-by: Andrey Kolkov <[email protected]>
1 parent f91841f commit 2932ecc

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

‎packages/extra/etcd/templates/etcd-cluster.yaml‎

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,3 +275,50 @@ spec:
275275
app.kubernetes.io/managed-by: etcd-operator
276276
app.kubernetes.io/name: etcd
277277
version: {{ $.Chart.Version }}
278+
---
279+
# Transitional headless Service backing the LEGACY per-pod DNS names.
280+
#
281+
# `etcd-migrate` adopts legacy clusters IN PLACE — the existing Pods are never
282+
# recreated, so they keep their original `spec.subdomain: etcd-headless` (and
283+
# hostname etcd-<i>). Their stable DNS name therefore stays
284+
# `etcd-<i>.etcd-headless.<ns>.svc`, which the v1alpha2 operator dials for
285+
# MemberList/health until the members are eventually rolled onto its native
286+
# `<member>.etcd.<ns>.svc` domain (served by the operator-owned `etcd` Service).
287+
#
288+
# The v1alpha2 operator only creates the native `etcd` Service, and the legacy
289+
# `etcd-headless` Service (previously owned by the old operator) is pruned during
290+
# the transition. Without a Service named `etcd-headless`, the adopted Pods'
291+
# `etcd-<i>.etcd-headless.<ns>.svc` records stop resolving (`no such host`),
292+
# MemberList fails, and status.readyMembers never populates — the cluster never
293+
# goes Ready even though the etcd processes are healthy and in quorum. This is
294+
# the DNS counterpart of the legacy `*.etcd-headless.<ns>.svc` wildcard kept in
295+
# the server/peer cert SANs above for the same transition window.
296+
#
297+
# Selector mirrors the operator's native `etcd` Service
298+
# (etcd-operator.cozystack.io/cluster), so this resolves the same member Pods;
299+
# publishNotReadyAddresses keeps peer discovery working while a member is not
300+
# yet Ready. Safe to remove — together with the legacy cert SAN — once the
301+
# members have been rolled onto the native `etcd` subdomain.
302+
apiVersion: v1
303+
kind: Service
304+
metadata:
305+
name: etcd-headless
306+
namespace: {{ .Release.Namespace }}
307+
labels:
308+
app.kubernetes.io/name: etcd
309+
app.kubernetes.io/instance: {{ .Release.Name }}
310+
cozystack.io/service: etcd
311+
spec:
312+
clusterIP: None
313+
publishNotReadyAddresses: true
314+
selector:
315+
etcd-operator.cozystack.io/cluster: etcd
316+
ports:
317+
- name: client
318+
port: 2379
319+
targetPort: 2379
320+
protocol: TCP
321+
- name: peer
322+
port: 2380
323+
targetPort: 2380
324+
protocol: TCP

0 commit comments

Comments
 (0)