TECH-17408: Start healthcheck server earlier#3
Merged
gwynethallwright merged 1 commit intorelease/0.49.x-invocafrom Apr 17, 2025
Merged
Conversation
lhaven-invoca
approved these changes
Apr 17, 2025
lhaven-invoca
left a comment
There was a problem hiding this comment.
Discussion here: https://invoca.slack.com/archives/C05L6BZ1C8N/p1744825392784599
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.
This PR makes a small adjustment to the part of the code that initializes a health check server on port 8080. When queried, the health check server will attempt to reach out to Consul and ask who the leader of the cluster is. We use this endpoint to set up probes as part of our
consul-syncKubernetes Deployment.The problem with the above is that, with the addition of
resource.PopulateInitialServices()coming from #2, we are taking a variable (but longer) amount of time to get to the point in the code where we would usually initialize the health check server. This is not ideal, because if we take too long, the Kubernetes probes will cause our Pods to restart.In this PR, we set up the health check server much earlier — just after setting up the Consul client that is necessary in order to perform the health checks.