Skip to content

Commit 15e4dbd

Browse files
committed
KEP-1645: define dual stack policies and fields
Signed-off-by: Arthur Outhenin-Chalandre <[email protected]>
1 parent 0478769 commit 15e4dbd

File tree

1 file changed

+28
-11
lines changed
  • keps/sig-multicluster/1645-multi-cluster-services-api

1 file changed

+28
-11
lines changed

keps/sig-multicluster/1645-multi-cluster-services-api/README.md

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -362,10 +362,6 @@ aware routing, but that API is currently in flux. As a result this proposal is
362362
only suited to same-region multi-cluster services until the topology API
363363
progresses.
364364

365-
As the plan for dual stack support is finalized, the Multi-Cluster Services API
366-
will follow dual stack Service design. Until then, dual stack will not be
367-
supported.
368-
369365
[Service Topology API]:
370366
https://kubernetes.io/docs/concepts/services-networking/service-topology/
371367

@@ -488,6 +484,18 @@ and `spec.exportedAnnotations`. Exporting labels and annotations is optionally
488484
supported by MCS-API implementations. If supported, annotations or labels must
489485
not be exported from the `metadata` of the `Service` or `ServiceExport` resources.
490486

487+
An implementation may use the `ipFamilies` field from the exported Services as
488+
a hint to influence the `IPs` and `ipFamilies` of the ServiceImport object.
489+
The exact mechanism for determining those fields is implementation-defined.
490+
If `ipFamilies` is set on the ServiceImport object, it must not have duplicated
491+
families (for instance `ipFamilies: [IPv4, IPv4]` is not valid) and the IPs
492+
should eventually be in the same order as what is defined in `ipFamilies`.
493+
494+
Also note that even in a dual stack cluster regular Services are by default SingleStack
495+
which might default to IPv4 or IPv6 depending on the cluster configuration and there
496+
are various constraints when mutating `ipFamilies` and `ipFamilyPolicy` on a Service
497+
(see [ref](https://kubernetes.io/docs/concepts/services-networking/dual-stack/)).
498+
491499
Deleting a `ServiceExport` will stop exporting the name-mapped `Service`.
492500

493501
#### Restricting Exports
@@ -566,9 +574,12 @@ const (
566574
type ServiceImportSpec struct {
567575
// +listType=atomic
568576
Ports []ServicePort `json:"ports"`
569-
// +kubebuilder:validation:MaxItems:=1
577+
// +kubebuilder:validation:MaxItems:=2
570578
// +optional
571579
IPs []string `json:"ips,omitempty"`
580+
// +kubebuilder:validation:MaxItems:=2
581+
// +optional
582+
IPFamilies []corev1.IPFamily `json:"ipFamilies,omitempty"`
572583
// +optional
573584
Type ServiceImportType `json:"type"`
574585
// +optional
@@ -637,6 +648,8 @@ metadata:
637648
spec:
638649
ips:
639650
- 42.42.42.42
651+
ipFamilies:
652+
- IPv4
640653
type: "ClusterSetIP"
641654
ports:
642655
- name: http
@@ -696,12 +709,16 @@ this cluster.
696709

697710
#### ClusterSetIP
698711

699-
A non-headless `ServiceImport` is expected to have an associated IP address, the
700-
clusterset IP, which may be accessed from within an importing cluster. This IP
701-
may be a single IP used clusterset-wide or assigned on a per-cluster basis, but
702-
is expected to be consistent for the life of a `ServiceImport` from the
703-
perspective of the importing cluster. Requests to this IP from within a cluster
704-
will route to backends for the aggregated Service.
712+
A non-headless `ServiceImport` is expected to have associated IP addresses, the
713+
clusterset IPs, which may be accessed from within an importing cluster. These IPs
714+
may be used clusterset-wide or assigned on a per-cluster basis, but is expected
715+
to be consistent for the life of a `ServiceImport` from the perspective of the
716+
importing cluster. Requests to these IPs from within a cluster will route to
717+
backends for the aggregated Service. The `IPs` field must correspond to the
718+
protocols defined in the `ipFamilies` field, if specified. How the `ipFamilies`
719+
field is determined is implementation-defined, for instance it might correspond
720+
to what IP protocols the constituent `ServiceExport`s support or only the IP
721+
protocols that the local cluster supports.
705722

706723
Note: this doc does not discuss `NetworkPolicy`, which cannot currently be used
707724
to describe a selector based policy that applies to a multi-cluster service.

0 commit comments

Comments
 (0)