@@ -362,10 +362,6 @@ aware routing, but that API is currently in flux. As a result this proposal is
362
362
only suited to same-region multi-cluster services until the topology API
363
363
progresses.
364
364
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
-
369
365
[ Service Topology API] :
370
366
https://kubernetes.io/docs/concepts/services-networking/service-topology/
371
367
@@ -488,6 +484,18 @@ and `spec.exportedAnnotations`. Exporting labels and annotations is optionally
488
484
supported by MCS-API implementations. If supported, annotations or labels must
489
485
not be exported from the `metadata` of the `Service` or `ServiceExport` resources.
490
486
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
+
491
499
Deleting a `ServiceExport` will stop exporting the name-mapped `Service`.
492
500
493
501
# ### Restricting Exports
@@ -566,9 +574,12 @@ const (
566
574
type ServiceImportSpec struct {
567
575
// +listType=atomic
568
576
Ports []ServicePort `json:"ports"`
569
- // +kubebuilder:validation:MaxItems:=1
577
+ // +kubebuilder:validation:MaxItems:=2
570
578
// +optional
571
579
IPs []string `json:"ips,omitempty"`
580
+ // +kubebuilder:validation:MaxItems:=2
581
+ // +optional
582
+ IPFamilies []corev1.IPFamily `json:"ipFamilies,omitempty"`
572
583
// +optional
573
584
Type ServiceImportType `json:"type"`
574
585
// +optional
@@ -637,6 +648,8 @@ metadata:
637
648
spec :
638
649
ips :
639
650
- 42.42.42.42
651
+ ipFamilies :
652
+ - IPv4
640
653
type : " ClusterSetIP"
641
654
ports :
642
655
- name : http
@@ -696,12 +709,16 @@ this cluster.
696
709
697
710
# ### ClusterSetIP
698
711
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.
705
722
706
723
Note : this doc does not discuss `NetworkPolicy`, which cannot currently be used
707
724
to describe a selector based policy that applies to a multi-cluster service.
0 commit comments