13
13
- [ Mapping] ( #mapping )
14
14
- [ Endpoint Port] ( #endpoint-port )
15
15
- [ Topology (Per Endpoint)] ( #topology-per-endpoint )
16
+ - [ Converting Topology in EndpointSlice GA] ( #converting-topology-in-endpointslice-ga )
17
+ - [ Zone (Per Endpoint)] ( #zone-per-endpoint )
16
18
- [ EndpointSlice Naming] ( #endpointslice-naming )
17
19
- [ Estimation] ( #estimation )
18
20
- [ Sample Case 1: 20,000 endpoints, 5,000 nodes] ( #sample-case-1-20000-endpoints-5000-nodes )
@@ -209,21 +211,20 @@ type Endpoint struct {
209
211
// endpoint.
210
212
// +optional
211
213
TargetRef *v1.ObjectReference ` json:"targetRef,omitempty" protobuf:"bytes,4,opt,name=targetRef"`
212
- // topology contains arbitrary topology information associated with the
213
- // endpoint. These key/value pairs must conform with the label format.
214
- // https://kubernetes.io/docs/concepts/overview/working-with-objects/labels
215
- // Topology may include a maximum of 16 key/value pairs. For endpoints
216
- // backed by Kubernetes Pods, This may include, but is not limited to the
217
- // following well known keys:
218
- // * kubernetes.io/hostname: the value indicates the hostname of the node
219
- // where the endpoint is located. This should match the corresponding
220
- // node label.
221
- // * topology.kubernetes.io/zone: the value indicates the zone where the
222
- // endpoint is located. This should match the corresponding node label.
223
- // * topology.kubernetes.io/region: the value indicates the region where the
224
- // endpoint is located. This should match the corresponding node label.
214
+
215
+ // topology was a beta feature for Endpoint to store arbitrary topology
216
+ // information. The values of this field are persisted as an anotation on
217
+ // on the EndpointSlice starting in v1.
218
+ // +k8s:deprecated=topology,protobuf=5
219
+
220
+ // nodeName represents the name of the Node hosting this endpoint. This can
221
+ // be used to determine endpoints local to a Node. This field can be enabled
222
+ // with the EndpointSliceNodeName feature gate.
223
+ // +optional
224
+ NodeName *string ` json:"nodeName,omitempty" protobuf:"bytes,6,opt,name=nodeName"`
225
+ // zone is the name of the Zone this endpoint exists in.
225
226
// +optional
226
- Topology map [ string ] string ` json:"topology ,omitempty" protobuf:"bytes,5 ,opt,name=topology "`
227
+ Zone * string ` json:"zone ,omitempty" protobuf:"bytes,7 ,opt,name=zone "`
227
228
}
228
229
229
230
// EndpointConditions represents the current condition of an endpoint.
@@ -290,6 +291,10 @@ core/v1 Endpoints API is required. This allows the API to support services with
290
291
no port remapping or all port services.
291
292
292
293
### Topology (Per Endpoint)
294
+ ** DEPRECATED** in v1.20 and will be removed in v1.21.
295
+ This field will remain in v1beta1 and a conversion functionality will exist to
296
+ convert to and from v1.
297
+
293
298
A new topology field (string to string map) is added to each endpoint. It can
294
299
contain arbitrary topology information associated with the endpoint. If the
295
300
EndpointSlice instance is derived from K8s service, the topology may contain
@@ -304,6 +309,46 @@ following well known key:
304
309
If the Kubernetes Service has topological keys specified, the corresponding node
305
310
labels will be copied to endpoint topology.
306
311
312
+ ### Converting Topology in EndpointSlice GA
313
+
314
+ For beta resources that have set the topology field, the string to string map
315
+ will be converted into an annotation on the v1 resource with the key
316
+ ** endpointslice.kubernetes.io/v1beta1-topology** . The annotation encoding will
317
+ allow the topology information to be roundtripped between v1beta1 and v1
318
+ resources.
319
+
320
+ The size limits of the topology field is 63B per key and per value, with a
321
+ maximum of 126B per key-value pair. The maximum number of endpoints in an
322
+ EndpointSlice is 1000.
323
+
324
+ ```
325
+ {Max Key-Value Pairs} * ({Max Key Size} + {Max Value Size}) * {Max Endpoints}
326
+ 16 * (63 + 63) * 1000 = 2,016,000b
327
+ ```
328
+
329
+ The maximum value of the combined maps in the endpoints is almost a factor of
330
+ 10 greater than the max annotation size (256kB). This is a worst case scenario,
331
+ which is unlikely as the recommendation and default is 100 endpoints. In
332
+ situations where the size is over the annotation limit, keys will be dropped from
333
+ the topology maps starting with the non-standard ones. All of the endpoint
334
+ topology maps will be encoded in an annotation and can be decoded back into the
335
+ individual topology maps as needed. As there is no uniqueness guarantee on any
336
+ of the endpoint fields, the index of the endpoint will be used when generating
337
+ the annotation. Therefore any insertions, removals, and reordering of
338
+ endpoints while using v1 clients will require the annotation to be
339
+ regenerated.
340
+
341
+ The only key in the topology field that will not be preserved in the annotation
342
+ will be ** topology.kubernetes.io/zone** and instead its value will be converted
343
+ into the [ zone field] ( #zone-per-endpoint ) on the Endpoint.
344
+
345
+ ### Zone (Per Endpoint)
346
+ A new ` zone ` field (string) is added to each endpoint that will indicate the
347
+ zone where the endpoint is located. For resources before ` v1 ` where the
348
+ topology field is populated, if ** topology.kubernetes.io/zone** exists, the
349
+ value of that key will be converted to this new ` zone ` field. When converting
350
+ back to a beta resource, the value will be added back to the endpoint's map.
351
+
307
352
### EndpointSlice Naming
308
353
Use ` generateName ` with the Service name as prefix:
309
354
```
@@ -643,8 +688,9 @@ The following will need to be covered as part of the testing plan:
643
688
Default**
644
689
* The EndpointSlice API will graduate to v1.
645
690
* The topology field will be removed.
691
+ * A new Zone field will be added to provide per endpoint topology information.
646
692
* ` EndpointSliceNodeName ` feature gate will graduate to beta.
647
- * ` EndpointSliceProxying ` feature gate will graduate to beta on Windows:
693
+ * ` WindowsEndpointSliceProxying ` feature gate will graduate to beta on Windows:
648
694
* Kube-Proxy on Windows will use EndpointSlices by default.
649
695
* A new ` endpoints.kubernetes.io/over-capacity ` label will be set to "warning"
650
696
on Endpoints resources exceeding 1000 endpoints.
0 commit comments