-
Notifications
You must be signed in to change notification settings - Fork 326
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
Update health check status based on the endpoints object instead of pod #503
Conversation
5fbdcc2
to
e928fbd
Compare
Previously, we were updating health check status based on the pod status of the pod that the endpoints address is pointing to. However, since the endpoints controller is not watching pod objects, it will not always have the most updated pod information in the cache. This results in incorrect behavior where sometimes the pod we get will have stale information and we update the health check status in Consul incorrectly. This commit changes this behavior to instead get the health check status from the endpoints object. The endpoints object already has information about ready and not ready addresses, and it will always have updated cache since we receive events based on updates from the Kubernetes API server to the cached Informer.
e928fbd
to
9ddfbfb
Compare
eb609b9
to
be3f922
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.
Nice work!
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.
Looks great to me, awesome job tracking this down and I like the decision to look at the Endpoints object. Thanks for all the context in the PR as well. Nice work!!!
Previously, we were updating health check status based on the pod status
of the pod that the endpoints address is pointing to. However, since the
endpoints controller is not watching pod objects, it will not always have
the most updated pod information in the cache. This results in incorrect behavior
where sometimes the pod we get will have stale information and we update the
health check status in Consul incorrectly.
This PR changes this behavior to instead get the health check status from
the endpoints object. The endpoints object already has information about ready
and not ready addresses, and it will always have updated cache since we receive
events based on updates from the Kubernetes API server to the cached Informer.
How I've tested this PR:
Acceptance test here
How I expect reviewers to test this PR:
code review
Checklist: