Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure non-ready endpoints are not added to upstreams #3541

Merged
merged 2 commits into from
Feb 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions internal/k8s/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -3567,6 +3567,9 @@ func getEndpointsFromEndpointSlicesForSubselectedPods(targetPort int32, pods []*
continue
}
for _, endpoint := range endpointSlice.Endpoints {
if !*endpoint.Conditions.Ready {
continue
}
for _, address := range endpoint.Addresses {
if pod.Status.PodIP == address {
addr := ipv6SafeAddrPort(pod.Status.PodIP, targetPort)
Expand Down Expand Up @@ -3718,6 +3721,9 @@ func (lbc *LoadBalancerController) getEndpointsForPortFromEndpointSlices(endpoin
for _, endpointSlicePort := range endpointSlice.Ports {
if *endpointSlicePort.Port == targetPort {
for _, endpoint := range endpointSlice.Endpoints {
if !*endpoint.Conditions.Ready {
continue
}
for _, endpointAddress := range endpoint.Addresses {
address := ipv6SafeAddrPort(endpointAddress, *endpointSlicePort.Port)
podEndpoint := podEndpoint{
Expand Down
Loading