FEATURE STATE: Kubernetes v1.16
alpha
Endpoint Slices provide a simple way to track network endpoints within a Kubernetes cluster. They offer a more scalable and extensible alternative to Endpoints. 端點切片提供了一種在kubernetes叢集中跟蹤網路端點的簡單方法。它們提供了一種更具伸縮性和可擴充套件性的端點替代方案。
Endpoint Slice resources
In Kubernetes, an Endpoint Slice contains references to a set of network endpoints. The EndpointSlice controller automatically creates Endpoint Slices for a Kubernetes Service when a selector is specified. These Endpoint Slices will include references to any Pods that match the Service selector. Endpoint Slices group network endpoints together by unique Service and Port combinations. 在kubernetes中,端點片包含對一組網路端點的引用。當指定選擇器時,endpointslice控制器自動為kubernetes服務建立端點片。這些端點切片將包括對與服務選擇器匹配的任何pod的引用。端點切片通過唯一的服務和埠組合將網路端點組合在一起。
As an example, here’s a sample EndpointSlice resource for the example
Kubernetes Service. 例如,這裡是“example”kubernetes服務的endpointslice資源示例。
apiVersion: discovery.k8s.io/v1alpha1
kind: EndpointSlice
metadata:
name: example-abc
labels:
kubernetes.io/service-name: example
addressType: IP
ports:
- name: http
protocol: TCP
port: 80
endpoints:
- addresses:
- "10.1.2.3"
- "2001:db8::1234:5678"
conditions:
ready: true
hostname: pod-1
topology:
kubernetes.io/hostname: node-1
topology.kubernetes.io/zone: us-west2-a
By default, Endpoint Slices managed by the EndpointSlice controller will have no more than 100 endpoints each. Below this scale, Endpoint Slices should map 1:1 with Endpoints and Services and have similar performance. 預設情況下,由endpointslice控制器管理的端點切片每個端點不超過100個。在這個比例之下,端點切片應該與端點和服務的比例為1:1,並且具有類似的效能。
Endpoint Slices can act as the source of truth for kube-proxy when it comes to how to route internal traffic. When enabled, they should provide a performance improvement for services with large numbers of endpoints. 當涉及到如何路由內部流量時,端點切片可以作為kube代理的真實來源。啟用後,它們應該為具有大量端點的服務提供效能改進。
Motivation
The Endpoints API has provided a simple and straightforward way of tracking network endpoints in Kubernetes. Unfortunately as Kubernetes clusters and Services have gotten larger, limitations of that API became more visible. Most notably, those included challenges with scaling to larger numbers of network endpoints. endpoints api提供了一種簡單而直接的方法來跟蹤kubernetes中的網路端點。不幸的是,隨著kubernetes叢集和服務變得越來越大,api的侷限性變得更加明顯。最值得注意的是,這些挑戰包括擴充套件到更多的網路端點。
Since all network endpoints for a Service were stored in a single Endpoints resource, those resources could get quite large. That affected the performance of Kubernetes components (notably the master control plane) and resulted in significant amounts of network traffic and processing when Endpoints changed. Endpoint Slices help you mitigate those issues as well as provide an extensible platform for additional features such as topological routing. 由於服務的所有網路終結點都儲存在單個終結點資源中,因此這些資源可能會變得非常大。這會影響kubernetes元件(尤其是主控制平面)的效能,並在端點發生更改時導致大量網路流量和處理。端點切片可以幫助您減輕這些問題,併為其他功能(如拓撲路由)提供一個可擴充套件的平臺。
What's next
Feedback
Was this page helpful?
本作品採用《CC 協議》,轉載必須註明作者和本文連結