[feature request]improve discardcloudservice filter in yurthub component
rambohe-ch opened this issue · comments
What would you like to be added:
Because clients on edges nodes can not connect cloud applications through pod ip, so LoadBalancer service for cloud application is discarded in yurthub component in order to make kube-proxy unaware of LoadBalancer service on edge nodes. and only LoadBalancer service with annotation openyurt.io/skip-discard=true
will be skipped.
the following are detail codes:
openyurt/pkg/yurthub/filter/discardcloudservice/filter.go
Lines 81 to 86 in 81d21b7
but in the proposal: https://github.com/openyurtio/openyurt/blob/master/docs/proposals/20231121-high-availability-of-edge-services.md, LoadBalancer service across NodePools will be supported, this means that LoadBalancer service should be aware of on edge nodes.
so we will improve discardcloudservice filter in yurthub component, and only discard LoadBalancer service which has annotation svc.openyurt.io/discard=true
, this means that LoadBalancer service will not be discarded by default.
others
/kind feature
It seems we first need to add a new annotation svc.openyurt.io/discard=true
after line 48 in the following code
openyurt/pkg/yurthub/filter/constant.go
Line 48 in 81d21b7
and then we need to modify the following code, discard LoadBalancer service which has
svc.openyurt.io/discard=true
, instead of which doesn't have openyurt.io/skip-discard=true
.openyurt/pkg/yurthub/filter/discardcloudservice/filter.go
Lines 81 to 86 in 81d21b7
I have raised a pr to implement the logic described above to fix this issue.
It seems we first need to add a new annotation
svc.openyurt.io/discard=true
after line 48 in the following codeopenyurt/pkg/yurthub/filter/constant.go
Line 48 in 81d21b7
and then we need to modify the following code, discard LoadBalancer service which has
svc.openyurt.io/discard=true
, instead of which doesn't haveopenyurt.io/skip-discard=true
.
openyurt/pkg/yurthub/filter/discardcloudservice/filter.go
Lines 81 to 86 in 81d21b7
I have raised a pr to implement the logic described above to fix this issue.
@huangchenzhao yes, you're right. by the way, unit tests also should be tuned.