From bf54b7827061829d18edd03266479d7ec93ed4fc Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Wed, 24 May 2023 22:19:13 +0200 Subject: [PATCH] feat: add /healthz and /readyz endpoints for kubernetes (#374) --- api/api.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/api/api.go b/api/api.go index b8d77f2..872d3ed 100644 --- a/api/api.go +++ b/api/api.go @@ -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))