File tree 1 file changed +16
-0
lines changed
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ This POSIX compliant sh script gets php-fpm status page using `cgi-fcgi` tool, p
7
7
- [ Motivation] ( #motivation )
8
8
- [ Installation] ( #installation )
9
9
- [ Usage] ( #usage )
10
+ - [ Docker example] ( #docker-example )
10
11
- [ Kubernetes example] ( #kubernetes-example )
11
12
- [ Why POSIX sh?] ( #why-posix-sh )
12
13
- [ Author and License] ( #author )
@@ -155,6 +156,18 @@ $ echo $?
155
156
0
156
157
```
157
158
159
+ ## Docker example
160
+
161
+ You can use ` HEALTHCHECK ` command on ` Dockerfile ` to define the health of your
162
+ container. According to (Docker Docs)[ https://docs.docker.com/engine/reference/builder/#healthcheck ] ,
163
+ possible return values are ` 0 ` for success, ` 1 ` to unhealthy and ` 2 ` is reserved
164
+ and we ** must not** use this exit code.
165
+
166
+ ``` Dockerfile
167
+ HEALTHCHECK --interval=5s --timeout=1s \
168
+ CMD php-fpm-healthcheck || exit 1
169
+ ```
170
+
158
171
## Kubernetes example
159
172
160
173
More and more people are looking for health checks on kubernetes for php-fpm, here is an example of livenessProbe and readinessProbe:
@@ -191,6 +204,9 @@ More and more people are looking for health checks on kubernetes for php-fpm, he
191
204
periodSeconds : 5
192
205
` ` `
193
206
207
+ Docker ` HEALTHCHECK` command is ignored on Kubernetes and you must define it
208
+ using pod specifications.
209
+
194
210
# # Why POSIX sh
195
211
196
212
Most of the containers contain limited software installed, using POSIX sh aims to be compatible with most of the OS images around.
You can’t perform that action at this time.
0 commit comments