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

Add readiness & liveness status check handlers #1293

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

charmitro
Copy link

This PR adds readiness and liveness status check handlers to the agent, which help ensure the health of the application in
Kubernetes.

Changes Made:

  • Added /readiness endpoint to check if the service is ready.
  • Added /liveness endpoint to check if the service is running.
  • Kept the existing root endpoint handler. (not sure if this is OK)

It should work in Kubernetes like,

        readinessProbe:
          httpGet:
            path: /readiness
            port: 8080
          initialDelaySeconds: 5
          periodSeconds: 10
        livenessProbe:
          httpGet:
            path: /liveness
            port: 8080
          initialDelaySeconds: 5
          periodSeconds: 10

Sadly I cannot test this because it needs some Google Cloud auth:

2024-07-29T23:01:12.775+0300    FATAL   cmd/main.go:92  failed to create firestore client       {"error": "google: could not find default credentials. See https://cloud.google.com/docs/authentication/external/set-up-adc for more information"}

@charmitro
Copy link
Author

I believe CI fails because it's a fork of the repository?

@kevmo314
Copy link
Contributor

kevmo314 commented Aug 4, 2024

Thanks for the PR! The ticket could've been more specific but the additional endpoints aren't actually necessary. We also don't use Kubernetes to deploy, really we only need some configuration set up in the GCP console. That being said, since the agent code hasn't changed much in the last few years, the utility of doing so it not very high.

I appreciate the help though, if you're interested we'd be more than happy to work in any frontend improvements you can think of.

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.

2 participants