Add a primary (write) Service routing to pod-0
Secondaries reject RFC2136/nsupdate writes, but the read Service round- robins across all pods. Add an optional per-cluster write endpoint that targets only the primary pod (ordinal 0) via the StatefulSet pod-name label. Reads keep using the all-pods Service. - api: BindCluster.spec.primaryService (*ClusterServiceSpec) — ClusterIP for in-cluster writers (external-dns) or LoadBalancer for external - reconcilePrimaryService creates <cluster>-primary selecting pod-0 when set, deletes it when unset - regenerate CRDs + install.yaml
This commit is contained in:
@@ -105,10 +105,18 @@ type BindClusterSpec struct {
|
||||
// +optional
|
||||
Resources corev1.ResourceRequirements `json:"resources,omitempty"`
|
||||
|
||||
// Service controls how the cluster is exposed.
|
||||
// Service controls how the cluster is exposed for reads (all pods).
|
||||
// +optional
|
||||
Service ClusterServiceSpec `json:"service,omitempty"`
|
||||
|
||||
// PrimaryService, when set, creates an additional Service routing only to the
|
||||
// primary pod (ordinal 0) — the write endpoint for RFC2136/nsupdate, since
|
||||
// secondaries reject updates. Reads still use Service (all pods). Use
|
||||
// ClusterIP for in-cluster writers (e.g. external-dns) or LoadBalancer for
|
||||
// external writers.
|
||||
// +optional
|
||||
PrimaryService *ClusterServiceSpec `json:"primaryService,omitempty"`
|
||||
|
||||
// NodeSelector for the BIND pods.
|
||||
// +optional
|
||||
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
|
||||
|
||||
@@ -301,6 +301,11 @@ func (in *BindClusterSpec) DeepCopyInto(out *BindClusterSpec) {
|
||||
}
|
||||
in.Resources.DeepCopyInto(&out.Resources)
|
||||
in.Service.DeepCopyInto(&out.Service)
|
||||
if in.PrimaryService != nil {
|
||||
in, out := &in.PrimaryService, &out.PrimaryService
|
||||
*out = new(ClusterServiceSpec)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.NodeSelector != nil {
|
||||
in, out := &in.NodeSelector, &out.NodeSelector
|
||||
*out = make(map[string]string, len(*in))
|
||||
|
||||
Reference in New Issue
Block a user