Coder Social home page Coder Social logo

Comments (13)

enocom avatar enocom commented on September 28, 2024 1

@markmandel How about pkg/health? In the past, I've found health checking often deserves its own package and eventually grows to justify it.

from agones.

markmandel avatar markmandel commented on September 28, 2024 1

So I don't see this being a Controller - in the Kubernetes sense (i.e. it doesn't manage resources in the cluster).

So I'd be more inclined to call it something else.

from agones.

enocom avatar enocom commented on September 28, 2024 1

OK. I'll leave the SDK sidecar alone.

Also, I agree: let's try https://github.com/heptiolabs/healthcheck for health-checking as you suggest.

from agones.

markmandel avatar markmandel commented on September 28, 2024

SGTM.

from agones.

enocom avatar enocom commented on September 28, 2024

Does health.NewHealthController or health.HealthController sound like a stutter? Wondering if this work includes renaming health.HealthController to just health.Controller to avoid the stuttering.

from agones.

enocom avatar enocom commented on September 28, 2024

Work for this issue is happening here. One thing I'm concerned about is the use of mocks in both the gameservers package tests and now the health package tests.

I see two options:

  1. Duplicate test_helpers.go in both packages and remove what is unneeded from both, or
  2. Promote test_helpers.go into its own shareable package.

I'll open a PR and we can discuss the best approach over there.

from agones.

markmandel avatar markmandel commented on September 28, 2024

To go back to design - the original idea was to implement something (or maybe use directly) something more akin to https://github.com/heptiolabs/healthcheck

My thought was:

  • cmd/controller would pass this through to each controller (currently there is only one)
  • Each controller's responsibility would be to add any checks it has (I'm actually not sure what to check - but that's an interesting discussion)
  • cmd/controller would be the one that starts the http endpoint.

Something similar to what I'm doing with the webhook manager is what I was thinking.

WDYT?

from agones.

enocom avatar enocom commented on September 28, 2024

That sounds good. So HealthController stays put, but the server which answers requests at /healthz gets moved out, while maybe gaining an AddCheck function that other controllers can use to register their own specialized check. Does that sound like what you're thinking?

from agones.

markmandel avatar markmandel commented on September 28, 2024

Yeah - sounds like we're on the same page.

And since I'm thinking about it - the pattern could potentially(?) be repeated for the sdk sidecar binary - since that also has a http handler in it (although it actually has 2 health points, one for itself and one as a proxy for the backing game server).

Since that also fires up a http server in it's Run() command, and it also feels a bit icky to me as well.

It may be worth talking over a hangout to discuss the architecture, if you think that would be valuable. Some of the design of the game server health checking is captured in this ticket

from agones.

enocom avatar enocom commented on September 28, 2024

This is the branch where I'm making the discussed changes.

from agones.

enocom avatar enocom commented on September 28, 2024

Seems like this should be extracted, too. Yes?

from agones.

markmandel avatar markmandel commented on September 28, 2024

Re: the SDK sidecar, I'm going to say let's leave that alone for now - it's bit more complex, and won't have multiple controllers running through it. But we can definitely review in the future if we see a nice reuse case there.

from agones.

enocom avatar enocom commented on September 28, 2024

Resolved by #98

from agones.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.