From 8362dcde6b45c7993cd2cdfe3a94e61902177d7c Mon Sep 17 00:00:00 2001 From: Shingo Omura Date: Wed, 25 Oct 2017 14:56:22 +0900 Subject: [PATCH] change default probe paths and listen port. This change is intended to align default values of related projects of https://github.com/heptiolabs/healthcheck#usage . --- README.md | 14 +++++++------- k8s-probes/src/main/resources/reference.conf | 6 +++--- .../everpeace/healthchecks/k8s/K8sProbesTest.scala | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index f678be4..5ca66c4 100644 --- a/README.md +++ b/README.md @@ -83,10 +83,10 @@ It supports to setup kubernetes liveness/readiness probe really easily like this import com.github.everpeace.healthchecks._ import com.github.everpeace.healthchecks.k8s._ - // by default, listening localhost:9999 + // by default, listening localhost:8086 // and probe paths are - // GET /k8s/liveness_probe - // GET /k8s/readiness_probe + // GET /live + // GET /ready val probeBinding = bindAndHandleProbes( readinessProbe(healthCheck(name = "readiness_check")(healthy)), livenessProbe(asyncHealthCheck(name = "liveness_check")(Future(healthy))) @@ -99,14 +99,14 @@ Then you can set kubernetes liveness/readiness probe in the kubernetes manifest ... livenessProbe: httpGet: - path: /k8s/liveness_probe - port: 9999 + path: /live + port: 8086 initialDelaySeconds: 3 periodSeconds: 3 readinessProbe: httpGet: - path: /k8s/readiness_probe - port: 9999 + path: /ready + port: 8086 initialDelaySeconds: 3 periodSeconds: 3 ... diff --git a/k8s-probes/src/main/resources/reference.conf b/k8s-probes/src/main/resources/reference.conf index fd8aa26..d568b81 100644 --- a/k8s-probes/src/main/resources/reference.conf +++ b/k8s-probes/src/main/resources/reference.conf @@ -1,8 +1,8 @@ k8s_probe { host = "localhost" - port = "9999" + port = "8086" path { - liveness = "/k8s/liveness_probe" - readiness = "/k8s/readiness_probe" + liveness = "/live" + readiness = "/ready" } } diff --git a/k8s-probes/src/test/scala/com/github/everpeace/healthchecks/k8s/K8sProbesTest.scala b/k8s-probes/src/test/scala/com/github/everpeace/healthchecks/k8s/K8sProbesTest.scala index 43a07c8..9d06e1e 100644 --- a/k8s-probes/src/test/scala/com/github/everpeace/healthchecks/k8s/K8sProbesTest.scala +++ b/k8s-probes/src/test/scala/com/github/everpeace/healthchecks/k8s/K8sProbesTest.scala @@ -48,9 +48,9 @@ class K8sProbesTest extends FreeSpec with Matchers { ) def requestToLivenessProbe = - Http().singleRequest(HttpRequest(uri = "http://localhost:9999/k8s/liveness_probe")) + Http().singleRequest(HttpRequest(uri = "http://localhost:8086/live")) def requestToReadinessProbe = - Http().singleRequest(HttpRequest(uri = "http://localhost:9999/k8s/readiness_probe")) + Http().singleRequest(HttpRequest(uri = "http://localhost:8086/ready")) val livenessResponse = Await.result(requestToLivenessProbe, 10 seconds) val redinessResponse = Await.result(requestToReadinessProbe, 10 seconds)