feat: add /healthz and /readyz endpoints for kubernetes (#374)

This commit is contained in:
Ettore Di Giacinto 2023-05-24 22:19:13 +02:00 committed by GitHub
parent 589dfae89f
commit bf54b78270
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -114,6 +114,14 @@ func App(opts ...AppOption) *fiber.App {
app.Static("/generated-images", options.imageDir)
}
ok := func(c *fiber.Ctx) error {
return c.SendStatus(200)
}
// Kubernetes health checks
app.Get("/healthz", ok)
app.Get("/readyz", ok)
// models
app.Get("/v1/models", listModels(options.loader, cm))
app.Get("/models", listModels(options.loader, cm))