Adds /healthz endpoint

And points k8s readiness and liveness probes on it
This commit is contained in:
Deni Bertovic 2019-06-18 10:09:47 +02:00
parent 82f363c24a
commit 98d0d61958
4 changed files with 9 additions and 4 deletions

View File

@ -8,6 +8,7 @@
/sitemap.xml SitemapR GET
/ HomeR GET
/healthz HealthzR GET
/snapshots AllSnapshotsR GET
/snapshot/#Text/*Texts OldSnapshotR GET

View File

@ -32,7 +32,7 @@ spec:
key: PGCONN
readinessProbe:
httpGet:
path: /
path: /healthz
port: 3000
httpHeaders:
# Works around stackage-server's `forceSSL` redirect
@ -44,7 +44,7 @@ spec:
successThreshold: 1
livenessProbe:
httpGet:
path: /
path: /healthz
port: 3000
httpHeaders:
# Works around stackage-server's `forceSSL` redirect

View File

@ -32,7 +32,7 @@ spec:
key: PGCONN
readinessProbe:
httpGet:
path: /
path: /healthz
port: 3000
httpHeaders:
# Works around stackage-server's `forceSSL` redirect
@ -44,7 +44,7 @@ spec:
successThreshold: 1
livenessProbe:
httpGet:
path: /
path: /healthz
port: 3000
httpHeaders:
# Works around stackage-server's `forceSSL` redirect

View File

@ -5,6 +5,7 @@
{-# LANGUAGE ViewPatterns #-}
module Handler.Home
( getHomeR
, getHealthzR
, getAuthorsR
, getInstallR
, getOlderReleasesR
@ -15,6 +16,9 @@ import Import
import Stackage.Database
import Yesod.GitRepo (grContent)
getHealthzR :: Handler String
getHealthzR = return "OK"
-- This is a handler function for the G request method on the HomeR
-- resource pattern. All of your resource patterns are defined in
-- config/routes