Backport: serviceentry: drain Terminating pods from ServiceEntry-derived endpoints#14334
Merged
davidjumani merged 1 commit intoJul 1, 2026
Merged
Conversation
…nts (kgateway-dev#14332) Signed-off-by: Nick Nellis <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
Backports the ServiceEntry endpoint selection fix to drain pods that are terminating (deletionTimestamp set) from ServiceEntry-derived EDS, so north-south traffic can fail over to healthy peer-cluster endpoints instead of sticking to a locally terminating pod during its grace period.
Changes:
- Extend
LocalityPodwithReadyandTerminatingsignals derived from Pod status/deletionTimestamp. - Filter ServiceEntry-derived endpoints to exclude NotReady and Terminating pod-backed workloads (while keeping WorkloadEntry/inline endpoints).
- Add unit coverage for both NotReady and Terminating filtering, and update envtest pod fixtures to mark pods Ready.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/krtcollections/pods.go | Add Ready/Terminating to LocalityPod, include in Equals, and populate from Pod status/deletionTimestamp. |
| pkg/kgateway/setup/testdata/setup_yaml/pods.yaml | Mark shared envtest pods as Ready so readiness-based selection behaves predictably in setup tests. |
| pkg/kgateway/extensions2/plugins/serviceentry/endpoints.go | Skip NotReady or Terminating pod-backed workloads when building ServiceEntry-derived endpoints. |
| pkg/kgateway/extensions2/plugins/serviceentry/endpoints_test.go | Add unit tests ensuring NotReady and Terminating pod-backed workloads are excluded while WorkloadEntry endpoints remain included. |
| pkg/kgateway/extensions2/plugins/serviceentry/collections.go | Ensure WorkloadEntry/inline endpoints are treated as Ready: true (and implicitly non-terminating) so they aren’t filtered by local pod state. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
davidjumani
approved these changes
Jun 30, 2026
davidjumani
enabled auto-merge
June 30, 2026 23:35
Merged
via the queue into
kgateway-dev:v2.2.x
with commit Jul 1, 2026
2b2e8b3
39 of 40 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Backport of #14332
Change Type
/kind fix
Changelog