-
Notifications
You must be signed in to change notification settings - Fork 7.9k
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
PILOT_SEND_UNHEALTHY_ENDPOINTS: exclude terminating endpoints #54711
PILOT_SEND_UNHEALTHY_ENDPOINTS: exclude terminating endpoints #54711
Conversation
The purpose of PILOT_SEND_UNHEALTHY_ENDPOINTS is to let envoy know about the count of health and unhealth endpoints as a factor into its failover decisions. For instance, if we have 5/10 pods health, it would failover. This has problematic behavior during scaling up/down. For instance, if I just have a single pod and then make a change, I will temporarily have 2 pods (the new one, and the old one terminating). Envoy will now see this as 50% health and failover. This is bad -- its not actually unhealthy at all! Additionally, when pods are scaling down we end up keeping them as unhealthy. Consider I have 1/2 pods healthy, and shut down the unhealthy one but it takes a few minutes to fully terminate. During that time, envoy will consider us 50% healthy. However, because we requested 1 pod and have 1 pod, I would consider that 100% healthy. ---- This PR adds a new health mode, "terminating". * When the feature flag is false, terminating and unhealthy mean the same thing -- do not send the endpoint to envoy. This has no impact. * When the feature flag is true, we will not sending terminating endpoints. This means a terminating endpoint is not taken into account for the health calculations. This change does not impact whether we send traffic to the terminating pods or not -- both before and after, we never do this. Note: there is another status, 'draining', which is a very specialized mode that is only used when session persistence is enabled on a service && the endpoint is terminating && it used to be healthy. Comments in the code clarify the differences between these two similar states. These endpoints *are* sent to envoy and traffic is sent to them, so its fundamentally different than Terminating.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIUC the main observable change in behavior here would be that failover happens later? I might not have it right tho.
I think the main cases are New rollout: Scaling: |
4cc7579
to
4c55534
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is an observable change (even for the better) it feels like it warrants a relnote, but LGTM.
This LGTM, but I agree with @bleggett on the release note. Adding a hold until that's done |
* upstream/master: make collections implement Syncer (istio#54750) Automator: update proxy@master in istio/istio@master (istio#54755) istioctl: support SA RBAC rule parsing (istio#54744) Automator: update proxy@master in istio/istio@master (istio#54754) Automator: update proxy@master in istio/istio@master (istio#54753) Automator: update ztunnel@master in istio/istio@master (istio#54749) Enable modifying the prow cluster name (istio#54742) Automator: update proxy@master in istio/istio@master (istio#54727) Fix crash when starting pilot without kubeClient (istio#54730) ambient: support `istio.io/ingress-use-waypoint` at the namespace level (istio#54483) Automator: update ztunnel@master in istio/istio@master (istio#54733) run make gen (istio#54728) Be more explicit about how Helm value deprecations should manifest in relnotes (istio#54697) PILOT_SEND_UNHEALTHY_ENDPOINTS: exclude terminating endpoints (istio#54711) Fix ambient telemetry in ingress gateways (istio#54383) Automator: update proxy@master in istio/istio@master (istio#54713) Gateway also needs global flattening (istio#54714) Automator: update common-files@master in istio/istio@master (istio#54712) Automator: update proxy@master in istio/istio@master (istio#54709) Do not impersonate empty group (istio#54667)
The purpose of PILOT_SEND_UNHEALTHY_ENDPOINTS is to let envoy know about
the count of health and unhealth endpoints as a factor into its failover
decisions. For instance, if we have 5/10 pods health, it would failover.
This has problematic behavior during scaling up/down. For instance, if I
just have a single pod and then make a change, I will temporarily have 2
pods (the new one, and the old one terminating). Envoy will now see this
as 50% health and failover. This is bad -- its not actually unhealthy at
all!
Additionally, when pods are scaling down we end up keeping them as
unhealthy. Consider I have 1/2 pods healthy, and shut down the unhealthy
one but it takes a few minutes to fully terminate. During that time,
envoy will consider us 50% healthy. However, because we requested 1 pod
and have 1 pod, I would consider that 100% healthy.
This PR adds a new health mode, "terminating".
same thing -- do not send the endpoint to envoy. This has no impact.
endpoints. This means a terminating endpoint is not taken into account
for the health calculations.
This change does not impact whether we send traffic to the terminating
pods or not -- both before and after, we never do this.
Note: there is another status, 'draining', which is a very specialized
mode that is only used when session persistence is enabled on a service
&& the endpoint is terminating && it used to be healthy. Comments in the
code clarify the differences between these two similar states. These
endpoints are sent to envoy and traffic is sent to them, so its
fundamentally different than Terminating.