You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: api/v1alpha2/etcdcluster_types.go
+23Lines changed: 23 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -435,6 +435,8 @@ type StorageSpec struct {
435
435
// +kubebuilder:validation:XValidation:rule="!has(self.auth) || !has(oldSelf.auth) || self.auth == oldSelf.auth",message="spec.auth is immutable post-create; delete and recreate the cluster to change auth configuration"
436
436
// +kubebuilder:validation:XValidation:rule="!(has(self.auth) && self.auth.enabled) || (has(self.tls) && has(self.tls.client))",message="spec.auth.enabled requires spec.tls.client (auth credentials must not cross a plaintext connection)"
// +kubebuilder:validation:XValidation:rule="has(self.headlessServiceName) == has(oldSelf.headlessServiceName)",message="spec.headlessServiceName cannot be added to or removed from an existing cluster; it is baked into member identity (peer URLs, pod subdomains)"
439
+
// +kubebuilder:validation:XValidation:rule="!has(self.headlessServiceName) || !has(oldSelf.headlessServiceName) || self.headlessServiceName == oldSelf.headlessServiceName",message="spec.headlessServiceName is immutable post-create; it is baked into member identity (peer URLs, pod subdomains)"
438
440
// +kubebuilder:validation:XValidation:rule="has(self.bootstrap) == has(oldSelf.bootstrap)",message="spec.bootstrap cannot be added to or removed from an existing cluster; it is consulted only at first bootstrap"
439
441
// +kubebuilder:validation:XValidation:rule="!has(self.bootstrap) || !has(oldSelf.bootstrap) || self.bootstrap == oldSelf.bootstrap",message="spec.bootstrap is immutable post-create; it is consulted only at first bootstrap"
440
442
// +kubebuilder:validation:XValidation:rule="!(has(self.bootstrap) && has(self.bootstrap.restore)) || !(has(self.storage) && has(self.storage.medium) && self.storage.medium == 'Memory')",message="spec.bootstrap.restore is unsupported with spec.storage.medium=Memory: the restored data dir is tmpfs, so any seed Pod restart re-restores the snapshot — reverting writes (single member) or breaking the cluster with a fresh ID it can't rejoin (multi-member). Use persistent storage to restore."
@@ -558,6 +560,27 @@ type EtcdClusterSpec struct {
558
560
// tuning change in place.
559
561
// +optional
560
562
Options*EtcdOptions`json:"options,omitempty"`
563
+
564
+
// HeadlessServiceName overrides the name of the headless Service the
565
+
// operator maintains for per-member DNS. Empty (the default) means
566
+
// the Service is named after the cluster. The name is baked into
567
+
// every member's identity — peer URLs persisted inside etcd, the
568
+
// Pods' spec.subdomain, and every endpoint the operator dials — so
569
+
// the field is immutable post-create (spec-level CEL, like
570
+
// storageClassName).
571
+
//
572
+
// The main consumer is in-place migration from the legacy
573
+
// etcd.aenix.io operator: its StatefulSet pods carry an immutable
574
+
// spec.subdomain of "<cluster>-headless" and their peer URLs are
575
+
// persisted in etcd under that DNS domain. Setting
576
+
// headlessServiceName to the legacy Service name makes the operator's
577
+
// constructed URLs match the adopted pods' actual DNS exactly, so
578
+
// discovery, scale-up and replacement work without any
0 commit comments