From 119bebf25b57eb73fbaca0ee87a062143b775bd5 Mon Sep 17 00:00:00 2001 From: Bobby Brennan Date: Tue, 7 May 2019 19:54:14 +0000 Subject: [PATCH] add /health endpoint --- deploy/dashboard.yaml | 4 ++-- deploy/helm/fairwinds/templates/dashboard.deployment.yaml | 4 ++-- main.go | 3 +++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/deploy/dashboard.yaml b/deploy/dashboard.yaml index 200a19e1c..fa576f14f 100644 --- a/deploy/dashboard.yaml +++ b/deploy/dashboard.yaml @@ -159,13 +159,13 @@ spec: - containerPort: 8080 livenessProbe: httpGet: - path: / + path: /health port: 8080 initialDelaySeconds: 5 periodSeconds: 5 readinessProbe: httpGet: - path: / + path: /health port: 8080 initialDelaySeconds: 15 periodSeconds: 20 diff --git a/deploy/helm/fairwinds/templates/dashboard.deployment.yaml b/deploy/helm/fairwinds/templates/dashboard.deployment.yaml index 700026ea4..de20628aa 100644 --- a/deploy/helm/fairwinds/templates/dashboard.deployment.yaml +++ b/deploy/helm/fairwinds/templates/dashboard.deployment.yaml @@ -36,13 +36,13 @@ spec: - containerPort: 8080 livenessProbe: httpGet: - path: / + path: /health port: 8080 initialDelaySeconds: 5 periodSeconds: 5 readinessProbe: httpGet: - path: / + path: /health port: 8080 initialDelaySeconds: 15 periodSeconds: 20 diff --git a/main.go b/main.go index ae1ff4757..c773caddd 100644 --- a/main.go +++ b/main.go @@ -84,6 +84,9 @@ func main() { } func startDashboardServer(c conf.Configuration, k *kube.ResourceProvider, port int) { + http.HandleFunc("/health", func(w http.ResponseWriter, r *http.Request) { + w.Write([]byte("OK")) + }) http.HandleFunc("/results.json", func(w http.ResponseWriter, r *http.Request) { dashboard.EndpointHandler(w, r, c, k) })