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

Fix graceful shutdown #101

Merged
merged 6 commits into from
Dec 14, 2023
Merged

Fix graceful shutdown #101

merged 6 commits into from
Dec 14, 2023

Conversation

clementnuss
Copy link
Contributor

I noticed that kubenurse was:

  • not waiting when shutting down (i.e. SIGTERM then the http server shuts down almost immediately).
  • not paying attention to pods in either Pending or Terminating "status", and was instead querying all pods.

In Kubenurse shutdown scenarios, this lead to erroneous me_ingress errors (i.e. when the pod has already closed its http server, but the ingress-nginx still has an inflight request that then timeouts), and to to false path_<node> errors as well, as terminating pods were still receiving queries.

together with that I fixed the build script a little 🙃

will already help prevent false positives from other kubenurse pods when
trying to reach me_ingress through the ingress controller during
teardown. without this 5sec wait, in-flight requests from e.g. the
ingress controller will reach a pod that is already terminated.
Might not be sufficient for similar for "path" errors, as there is no
filter for terminating pods.

Signed-off-by: Clément Nussbaumer <clement.nussbaumer@postfinance.ch>
during the first start of kubenurse, if the ingress isn't
ready yet or if kubenurse makes a check before a kubenurse
pod is actually ready, this will result in errors in the logs
and this will prevent the pipeline from working correctly.

Signed-off-by: Clément Nussbaumer <clement.nussbaumer@postfinance.ch>
Signed-off-by: Clément Nussbaumer <clement.nussbaumer@postfinance.ch>
prevents false positive path_error when checks are made to pending or
terminating pods

Signed-off-by: Clément Nussbaumer <clement.nussbaumer@postfinance.ch>
Copy link

github-actions bot commented Dec 13, 2023

Pull Request Test Coverage Report for Build 7207008932

  • 17 of 24 (70.83%) changed or added relevant lines in 4 files are covered.
  • 11 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-2.2%) to 76.42%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/servicecheck/transport.go 0 1 0.0%
internal/kubenurse/server.go 10 16 62.5%
Files with Coverage Reduction New Missed Lines %
internal/servicecheck/servicecheck.go 4 86.58%
internal/kubediscovery/nodewatcher.go 7 78.43%
Totals Coverage Status
Change from base Build 7198416239: -2.2%
Covered Lines: 444
Relevant Lines: 581

💛 - Coveralls

Signed-off-by: Clément Nussbaumer <clement.nussbaumer@postfinance.ch>
Signed-off-by: Clément Nussbaumer <clement.nussbaumer@postfinance.ch>
@clementnuss clementnuss merged commit e5c13c8 into master Dec 14, 2023
12 checks passed
@clementnuss clementnuss deleted the fix-graceful-shutdown branch January 22, 2024 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant