Open llhuii opened 3 years ago
endpoint slice KEP https://github.com/kubernetes/enhancements/tree/master/keps/sig-network/0752-endpointslices#motivation
解决单个endpoint 过大的情况,导致: 1)etcd可能拒绝单个endpoint 对象的更新 2)endpoint更新广播到kubeproxy的流量过大引起性能问题
流量均衡:将一个service下的endpoint根据zone的能力(即总核数)打散到各个zone。 流量优先:集群pod优先访问在同一个zone内的endpoint。
大致原理:
endpoint controller
给设置了selector的service 管理endpoint
list/watch service:更新serviceSelectorCache,将对应service加到队列 list/watch endpoint: 只监听删除事件,将对应service(endpoint与service同名)加到队列
list/watch pod:
pod的add事件: 添加匹配pod的selector的svc列表到队列中
pod的update事件:将GetServicesToUpdateOnPodChange添加到队列中
pod的删除事件:跟add事件处理一致
worker处理service对象逻辑: