Skip to content

Commit ccc1448

Browse files
committed
Rename ImportedService to ServiceImport
Rename based on PR feedback
1 parent 7284f55 commit ccc1448

File tree

1 file changed

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

1 file changed

+22
-22
lines changed

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

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -258,21 +258,21 @@ a `ServiceExport` in a cluster will signify that the `Service` with the same
258258
name and namespace as the export should be visible to other clusters in the
259259
supercluster.
260260

261-
Another CRD called `ImportedService` will be introduced to store information
261+
Another CRD called `ServiceImport` will be introduced to store information
262262
about the services exported from each cluster, e.g. topology. This is analogous
263263
to the traditional `Service` type in Kubernetes. Each cluster will have a
264-
coresponding `ImportedService` for each uniquely named `Service` that has been
264+
coresponding `ServiceImport` for each uniquely named `Service` that has been
265265
exported within the supercluster, referenced by namespaced name.
266266

267267
If multiple clusters export a `Service` with the same namespaced name, they will
268268
be recognized as a single combined service. For example, if 5 clusters export
269-
`my-svc.my-ns`, there will be one `ImportedService` named `my-svc` in the
269+
`my-svc.my-ns`, there will be one `ServiceImport` named `my-svc` in the
270270
`my-ns` namespace and it will be associated with endpoints from all exporting
271-
clusters. Properties of the `ImportedService` (e.g. ports, topology) will be
271+
clusters. Properties of the `ServiceImport` (e.g. ports, topology) will be
272272
derived from a merger of component `Service` properties.
273273

274274
Existing implementations of Kubernetes Service API (e.g. kube-proxy) can be
275-
extended to present `ImportedServices` alongside traditional `Services`.
275+
extended to present `ServiceImports` alongside traditional `Services`.
276276

277277

278278
### User Stories (optional)
@@ -536,40 +536,40 @@ that cluster’s lease expires.
536536
537537
To consume a supercluster service, users will use the domain name associated
538538
with their `ServiceExport`. When the mcsd-controller sees a `ServiceExport`, a
539-
`ImportedService` will be introduced, which can be largely ignored by the user.
539+
`ServiceImport` will be introduced, which can be largely ignored by the user.
540540
541-
An `ImportedService` is a service that may have endpoints in other clusters.
541+
An `ServiceImport` is a service that may have endpoints in other clusters.
542542
This includes 3 scenarios:
543543
1. This service is running entirely in different cluster(s)
544544
1. This service has endpoints in other cluster(s) and in this cluster
545545
1. This service is running entirely in this cluster, but is exported to other cluster(s) as well
546546
547547
For each exported service, one `ServiceExport` will exist in each cluster that
548548
runs the service. The mcsd-controller will create and maintain a derived
549-
`ImportedService` in each cluster within the supercluster (see: [constraints and
549+
`ServiceImport` in each cluster within the supercluster (see: [constraints and
550550
conflict resolution](#constraints-and-conflict-resolution)). If all `ServiceExport` instances are deleted, each
551-
`ImportedService` will also be deleted from all clusters.
551+
`ServiceImport` will also be deleted from all clusters.
552552
553-
Since a given `ImportedService` may be backed by multiple `EndpointSlices`, a
554-
given `EndpointSlice` will reference its `ImportedService` using the label
553+
Since a given `ServiceImport` may be backed by multiple `EndpointSlices`, a
554+
given `EndpointSlice` will reference its `ServiceImport` using the label
555555
`multicluster.kubernetes.io/imported-service-name` similarly to how an
556556
`EndpointSlice` is associated with its `Service` in a single cluster. Each
557557
imported `EndpointSlice` will also have a
558558
`multicluster.kubernetes.io/source-cluster` label with a registry-scoped unique
559559
identifier for the cluster.
560560
561561
```golang
562-
// ImportedService declares that the specified service should be exported to other clusters.
563-
type ImportedService struct {
562+
// ServiceImport declares that the specified service should be exported to other clusters.
563+
type ServiceImport struct {
564564
metav1.TypeMeta `json:",inline"`
565565
metav1.ObjectMeta `json:"metadata,omitempty"`
566566
567-
Spec ImportedServiceSpec `json:"spec,omitempty"`
567+
Spec ServiceImportSpec `json:"spec,omitempty"`
568568
}
569569
570-
// ImportedServiceSpec contains the current status of an imported service and the
570+
// ServiceImportSpec contains the current status of an imported service and the
571571
// information necessary to consume it
572-
type ImportedServiceSpec struct {
572+
type ServiceImportSpec struct {
573573
Ports []ServicePort `json:"ports"`
574574
Clusters []ClusterSpec `json:"clusters"`
575575
IPFamily corev1.IPFamily `json:"ipFamily"`
@@ -587,7 +587,7 @@ type ClusterSpec struct {
587587
```
588588
```yaml
589589
apiVersion: multicluster.k8s.io/v1alpha1
590-
kind: ImportedService
590+
kind: ServiceImport
591591
metadata:
592592
name: my-svc
593593
namespace: my-ns
@@ -615,7 +615,7 @@ metadata:
615615
ownerReferences:
616616
- apiVersion: multicluster.k8s.io/v1alpha1
617617
controller: false
618-
kind: ImportedService
618+
kind: ServiceImport
619619
name: my-svc
620620
addressType: IPv4
621621
ports:
@@ -631,7 +631,7 @@ endpoints:
631631
topology.kubernetes.io/zone: us-west2-a
632632
```
633633
634-
The `ImportedService.Spec.IP` (VIP) can be used to access this service from within this cluster.
634+
The `ServiceImport.Spec.IP` (VIP) can be used to access this service from within this cluster.
635635

636636
## Constraints and Conflict Resolution
637637

@@ -650,7 +650,7 @@ there is no clear way to determine how a service should be accessed. **If any
650650
global properties have conflicts that can not be resolved, a condition will be
651651
set on the `ServiceExport` with a description of the conflict. The service will
652652
not be synced, and an error will be set on the status of each affected
653-
`ServiceExport` and any previously-derived `ImportedServices` will be deleted
653+
`ServiceExport` and any previously-derived `ServiceImports` will be deleted
654654
from each cluster in the supercluster.**
655655

656656

@@ -700,7 +700,7 @@ from applying affinity on a per-slice basis so we will carry it forward.
700700
A `Service`’s `topologyKeys` dictate how endpoints in all `EndpointSlices`
701701
associated with a given service should be applied to each node. While a single
702702
`Service` may have multiple `EndpointSlices`, each `EndpointSlice` will only
703-
ever originate from a single `Service`. `ImportedService` will contain
703+
ever originate from a single `Service`. `ServiceImport` will contain
704704
label-mapped lists of `topologyKeys` synced from each originating exported
705705
service. Kube-proxy will filter endpoints in each slice based only on the
706706
`topologyKeys` defined on the slice’s specific source `Service`.
@@ -894,7 +894,7 @@ retain the flexibility of selectors.
894894
replaced with an annotation, e.g. `multicluster.kubernetes.io/export`. When a
895895
service is found with the annotation, it would be considered marked for export
896896
to the supercluster. The controller would then create `EndpointSlices` and an
897-
`ImportedService` in each cluster exactly as described above. Unfortunately,
897+
`ServiceImport` in each cluster exactly as described above. Unfortunately,
898898
`Service` does not have an extensible status and there is no way to represent
899899
the state of the export on the annotated `Service`. We could extend
900900
`Service.Status` to include `Conditions` and provide the flexibility we need,

0 commit comments

Comments
 (0)