Skip to content

Commit 7be0f38

Browse files
committed
clean up structs
1 parent ccc1448 commit 7be0f38

File tree

1 file changed

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

1 file changed

+67
-54
lines changed

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

Lines changed: 67 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -77,51 +77,47 @@ tags, and then generate with `hack/update-toc.sh`.
7777
-->
7878

7979
<!-- toc -->
80-
- [KEP-1645: Multi-Cluster Services API](#kep-1645-multi-cluster-services-api)
81-
- [Release Signoff Checklist](#release-signoff-checklist)
82-
- [Summary](#summary)
83-
- [Motivation](#motivation)
84-
- [Goals](#goals)
85-
- [Non-Goals](#non-goals)
86-
- [Proposal](#proposal)
87-
- [Terminology](#terminology)
88-
- [User Stories (optional)](#user-stories-optional)
89-
- [Different Services Each Deployed to Separate Cluster](#different-services-each-deployed-to-separate-cluster)
90-
- [Single Service Deployed to Multiple Clusters](#single-service-deployed-to-multiple-clusters)
91-
- [Notes/Constraints/Caveats (optional)](#notesconstraintscaveats-optional)
92-
- [Risks and Mitigations](#risks-and-mitigations)
93-
- [Design Details](#design-details)
94-
- [Exporting Services](#exporting-services)
95-
- [Restricting Exports](#restricting-exports)
96-
- [Exported Service Behavior Expectations](#exported-service-behavior-expectations)
97-
- [SuperclusterIP](#superclusterip)
98-
- [DNS](#dns)
99-
- [EndpointSlice](#endpointslice)
100-
- [Endpoint TTL](#endpoint-ttl)
101-
- [Service Types](#service-types)
102-
- [Consumption of EndpointSlice](#consumption-of-endpointslice)
103-
- [Constraints and Conflict Resolution](#constraints-and-conflict-resolution)
104-
- [Global Properties](#global-properties)
105-
- [Service Port](#service-port)
106-
- [IP Family](#ip-family)
107-
- [Component Level Properties](#component-level-properties)
108-
- [Session Affinity](#session-affinity)
109-
- [TopologyKeys](#topologykeys)
110-
- [Publish Not-Ready Addresses](#publish-not-ready-addresses)
111-
- [Test Plan](#test-plan)
112-
- [Graduation Criteria](#graduation-criteria)
113-
- [Alpha -> Beta Graduation](#alpha---beta-graduation)
114-
- [Beta -> GA Graduation](#beta---ga-graduation)
115-
- [Removing a deprecated flag](#removing-a-deprecated-flag)
116-
- [Upgrade / Downgrade Strategy](#upgrade--downgrade-strategy)
117-
- [Version Skew Strategy](#version-skew-strategy)
118-
- [Implementation History](#implementation-history)
119-
- [Drawbacks](#drawbacks)
120-
- [Alternatives](#alternatives)
121-
- [`ObjectReference` in `ServiceExport.Spec` to directly map to a `Service`](#objectreference-in-serviceexportspec-to-directly-map-to-a-service)
122-
- [Export services via label selector](#export-services-via-label-selector)
123-
- [Export via annotation](#export-via-annotation)
124-
- [Infrastructure Needed (optional)](#infrastructure-needed-optional)
80+
- [Release Signoff Checklist](#release-signoff-checklist)
81+
- [Summary](#summary)
82+
- [Motivation](#motivation)
83+
- [Goals](#goals)
84+
- [Non-Goals](#non-goals)
85+
- [Proposal](#proposal)
86+
- [Terminology](#terminology)
87+
- [User Stories (optional)](#user-stories-optional)
88+
- [Different Services Each Deployed to Separate Cluster](#different-services-each-deployed-to-separate-cluster)
89+
- [Single Service Deployed to Multiple Clusters](#single-service-deployed-to-multiple-clusters)
90+
- [Notes/Constraints/Caveats (optional)](#notesconstraintscaveats-optional)
91+
- [Risks and Mitigations](#risks-and-mitigations)
92+
- [Design Details](#design-details)
93+
- [Exporting Services](#exporting-services)
94+
- [Restricting Exports](#restricting-exports)
95+
- [Exported Service Behavior Expectations](#exported-service-behavior-expectations)
96+
- [SuperclusterIP](#superclusterip)
97+
- [DNS](#dns)
98+
- [EndpointSlice](#endpointslice)
99+
- [Endpoint TTL](#endpoint-ttl)
100+
- [Service Types](#service-types)
101+
- [Consumption of EndpointSlice](#consumption-of-endpointslice)
102+
- [Constraints and Conflict Resolution](#constraints-and-conflict-resolution)
103+
- [Global Properties](#global-properties)
104+
- [Service Port](#service-port)
105+
- [IP Family](#ip-family)
106+
- [Component Level Properties](#component-level-properties)
107+
- [Session Affinity](#session-affinity)
108+
- [TopologyKeys](#topologykeys)
109+
- [Publish Not-Ready Addresses](#publish-not-ready-addresses)
110+
- [Test Plan](#test-plan)
111+
- [Graduation Criteria](#graduation-criteria)
112+
- [Upgrade / Downgrade Strategy](#upgrade--downgrade-strategy)
113+
- [Version Skew Strategy](#version-skew-strategy)
114+
- [Implementation History](#implementation-history)
115+
- [Drawbacks](#drawbacks)
116+
- [Alternatives](#alternatives)
117+
- [<code>ObjectReference</code> in <code>ServiceExport.Spec</code> to directly map to a Service](#-in--to-directly-map-to-a-service)
118+
- [Export services via label selector](#export-services-via-label-selector)
119+
- [Export via annotation](#export-via-annotation)
120+
- [Infrastructure Needed (optional)](#infrastructure-needed-optional)
125121
<!-- /toc -->
126122

127123
## Release Signoff Checklist
@@ -248,7 +244,7 @@ nitty-gritty.
248244
association.
249245
- **mcsd-controller** - A controller that syncs services across clusters and
250246
makes them available for multi-cluster service discovery (MCSD) and
251-
connectivitiy. There may be multiple implementations, this doc describes
247+
connectivity. There may be multiple implementations, this doc describes
252248
expected common behavior.
253249

254250
We propose a new CRD called `ServiceExport`, used to specify which services
@@ -375,6 +371,10 @@ type ServiceExport struct {
375371
// ServiceExportStatus contains the current status of an export.
376372
type ServiceExportStatus struct {
377373
// +optional
374+
// +patchStrategy=merge
375+
// +patchMergeKey=type
376+
// +listType=map
377+
// +listMapKey=type
378378
Conditions []ServiceExportCondition `json:"conditions,omitempty"`
379379
}
380380

@@ -562,26 +562,44 @@ identifier for the cluster.
562562
// ServiceImport declares that the specified service should be exported to other clusters.
563563
type ServiceImport struct {
564564
metav1.TypeMeta `json:",inline"`
565+
// +optional
565566
metav1.ObjectMeta `json:"metadata,omitempty"`
566-
567+
// +optional
567568
Spec ServiceImportSpec `json:"spec,omitempty"`
568569
}
569570
570571
// ServiceImportSpec contains the current status of an imported service and the
571572
// information necessary to consume it
572573
type ServiceImportSpec struct {
573-
Ports []ServicePort `json:"ports"`
574+
// +patchStrategy=merge
575+
// +patchMergeKey=port
576+
// +listType=map
577+
// +listMapKey=port
578+
// +listMapKey=protocol
579+
Ports []ServicePort `json:"ports"`
580+
// +optional
581+
// +patchStrategy=merge
582+
// +patchMergeKey=cluster
583+
// +listType=map
584+
// +listMapKey=cluster
574585
Clusters []ClusterSpec `json:"clusters"`
586+
// +optional
575587
IPFamily corev1.IPFamily `json:"ipFamily"`
588+
// +optional
576589
IP string `json:"ip,omitempty"`
577590
}
578591
579592
// ClusterSpec contains service configuration mapped to a specific cluster
580593
type ClusterSpec struct {
581594
Cluster string `json:"cluster"`
595+
// +optional
596+
// +listType=set
582597
TopologyKeys []string `json:"topologyKeys"`
598+
// +optional
583599
PublishNotReadyAddresses bool `json:"publishNotReadyAddresses"`
600+
// +optional
584601
SessionAffinity corev1.ServiceAffinity `json:"sessionAffinity"`
602+
// +optional
585603
SessionAffinityConfig *corev1.SessionAffinityConfig `json:"sessionAffinityConfig"`
586604
}
587605
```
@@ -845,7 +863,7 @@ not need to be as detailed as the proposal, but should include enough
845863
information to express the idea and why it was not acceptable.
846864
-->
847865

848-
### `ObjectReference` in `ServiceExport.Spec` to directly map to a `Service`
866+
### `ObjectReference` in `ServiceExport.Spec` to directly map to a Service
849867

850868
Instead of name mapping, we could use an explicit `ObjectReference` in a
851869
`ServiceExport.Spec`. This feels familiar and more explicit, but fundamentally
@@ -862,8 +880,6 @@ The above issues could also be solved via controller logic, but we would risk
862880
differing implementations. Name mapping enforces behavior at the API.
863881

864882
### Export services via label selector
865-
```
866-
<<[UNRESOLVED still being explored as viable - @thockin @mangelajo]>>
867883

868884
Instead of name mapping, `ServiceExport` could have a
869885
`ServiceExport.Spec.ServiceSelector` to select matching services for export.
@@ -885,9 +901,6 @@ selector - perhaps by introducing something like a `ServiceExportPolicy`
885901
resource (out of scope for this KEP). This would solve the above issues but
886902
retain the flexibility of selectors.
887903

888-
<<[/UNRESOLVED]>>
889-
```
890-
891904
### Export via annotation
892905

893906
`ServiceExport` as described has no spec and seems like it could just be

0 commit comments

Comments
 (0)