Skip to content

Commit

Permalink
feat(NSC): add endpoints that are ready or serving
Browse files Browse the repository at this point in the history
In order to be compliant with upstream network implementation
expectations we choose to proxy an endpoint as long as it is either
ready OR serving. This means that endpoints that are terminating will
still be proxied which makes kube-router conformant with the upstream
e2e tests.
  • Loading branch information
aauren committed Mar 1, 2024
1 parent efddb2e commit 16daa08
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pkg/controllers/proxy/network_services_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1081,12 +1081,12 @@ func (nsc *NetworkServicesController) buildEndpointSliceInfo() endpointSliceInfo
// protocol: TCP
//
for _, ep := range es.Endpoints {
// Previously, when we used endpoints, we only looked at subsets.addresses and not subsets.notReadyAddresses
// so here we need to limit our endpoints to only the ones that are ready. In the future, we could consider
// changing this to .Serving which continues to include pods that are in Terminating state. For now we keep
// it the same.
if ep.Conditions.Ready == nil || !*ep.Conditions.Ready {
klog.V(2).Infof("Endpoint (with addresses %s) does not have a ready status, skipping...", ep.Addresses)
// We should only look at serving or ready if we want to be compliant with the upstream expectantions of a
// network provider
if (ep.Conditions.Serving == nil || !*ep.Conditions.Serving) &&
(ep.Conditions.Ready == nil || !*ep.Conditions.Ready) {
klog.V(2).Infof("Endpoint (with addresses %s) does not have a ready or serving status, skipping...",
ep.Addresses)
continue
}

Expand Down

0 comments on commit 16daa08

Please sign in to comment.