Skip to content

Commit 7a32ce8

Browse files
committed
Merge pull request #135 from helgi/healthcheck_options
feat(healthchecks): improve healthcheck documentation, add new options and include defaults
2 parents e94105d + 291fffa commit 7a32ce8

1 file changed

Lines changed: 38 additions & 8 deletions

File tree

src/using-workflow/configuring-an-application.md

Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,44 @@ appname to the old one:
8080
By default, Workflow only checks that your application containers start in
8181
their Pod. If you would like Kubernetes to respond to appliation health, you
8282
may add a health check by configuring URL, port, initial delay, and timeout
83-
values. The health checks are implemented as [Kubernetes container probes][kubernetes-probes].
83+
values.
84+
85+
The health checks are implemented as [Kubernetes container probes][kubernetes-probes]. Currently only HTTP GET is supported.
86+
87+
Available configuration options for health checks are the following, including defaults:
88+
89+
**HEALTHCHECK_URL**
90+
91+
Path in the application to use for health check, such as /healthz - This value needs to be set for any health check to happen. Needs to accept a HTTP GET request and return a HTTP status between 200-399.
92+
93+
**HEALTHCHCK_PORT**
94+
95+
TCP port to use for health check. Defaults to using same port as the application
96+
97+
**HEALTHCHECK_TIMEOUT**
98+
99+
Number of seconds after which the health check times out. Defaults to 50 seconds
100+
101+
**HEALTHCHECK\_INITIAL_DELAY**
102+
103+
Number of seconds before health checks starts checking the application after the start of the pod.
104+
105+
This is useful to set if the application takes a while to get setup, due to migrations, cache warming or otherwise. Prevents Kubernetes (and Deis Workflow) from replacing an application pod in its setup phase.
106+
107+
Defaults to 50 seconds
108+
109+
**HEALTHCHECK\_PERIOD_SECONDS**
110+
111+
How often (in seconds) to perform the health check. Defaults every 10 seconds
112+
113+
**HEALTHCHECK\_SUCCESS_THRESHOLD**
114+
115+
Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1 success
116+
117+
**HEALTHCHECK\_FAILURE_THRESHOLD**
118+
119+
Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3 failures
84120

85-
* `HEALTHCHECK_URL`: the URL to visit for the health check (String, Default: `/`)
86-
* `HEALTHCHECK_PORT`: the TCP port to use for the health check (Integer, Default: `80` or `5000`)
87-
* `HEALTHCHECK_INITIAL_DELAY`: number of seconds to wait before sending health checks (Integer, Default: `50`)
88-
* `HEALTHCHECK_TIMEOUT`: number of seconds to wait before assuming the application is unhealthy (Integer, Default: `50`)
89121

90122
Configure these health checks on a per-application basis using `deis config:set`:
91123
```
@@ -109,8 +141,6 @@ HEALTHCHECK_URL: /200.html
109141
HEALTHCHECK_PORT: 5000
110142
```
111143

112-
Only HTTP-based health checks using the GET method are supported at this time.
113-
114144
If an application times out, or responds to a health check with a response code
115145
outside the 200-399 range, Kubernetes will stop sending requests to the
116146
application and re-schedule the pod to another node.
@@ -155,4 +185,4 @@ Use `deis rollback` to revert to a previous release.
155185
[stores config in environment variables]: http://12factor.net/config
156186
[release]: ../reference-guide/terms.md#release
157187
[router]: ../understanding-workflow/components.md#router
158-
[kubernetes-probes]: http://kubernetes.io/v1.1/docs/user-guide/pod-states.html#container-probes
188+
[kubernetes-probes]: http://kubernetes.io/docs/user-guide/pod-states/#container-probes

0 commit comments

Comments
 (0)