Skip to content

Commit

Permalink
Merge pull request #2 from everpeace/change-default-probe-paths-and-port
Browse files Browse the repository at this point in the history
change default probe paths and listen port.
  • Loading branch information
everpeace authored Oct 25, 2017
2 parents 4a9a48c + 8362dcd commit 5fcb401
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand All @@ -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
...
Expand Down
6 changes: 3 additions & 3 deletions k8s-probes/src/main/resources/reference.conf
Original file line number Diff line number Diff line change
@@ -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"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5fcb401

Please sign in to comment.