File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed
Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -99,6 +99,42 @@ $ echo $?
99990
100100```
101101
102+ ## Kubernetes example
103+
104+ More and more people are looking for health checks on kubernetes for php-fpm, here is an example of livenessProbe and readinessProbe:
105+
106+ ### livenessProbe
107+
108+ ``` yaml
109+ # PodSpec: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.10/#podspec-v1-core
110+ spec :
111+ containers :
112+ - name : " php-fpm"
113+ livenessProbe :
114+ exec :
115+ command :
116+ - php-fpm-healthcheck
117+ - --listen-queue-len=10 # fails if there are more than 10 processes waiting in the fpm queue
118+ - --accepted-conn=5000 # fails after fpm has served more than 5k requests, this will force the pod to reset, use with caution
119+ initialDelaySeconds : 0
120+ periodSeconds : 10
121+ ` ` `
122+
123+ ### readinessProbe
124+
125+ ` ` ` yaml
126+ # PodSpec: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.10/#podspec-v1-core
127+ spec :
128+ containers :
129+ - name : " php-fpm"
130+ readinessProbe :
131+ exec :
132+ command :
133+ - php-fpm-healthcheck # a simple ping since this means it's ready to handle traffic
134+ initialDelaySeconds : 1
135+ periodSeconds : 5
136+ ` ` `
137+
102138## Why POSIX sh
103139
104140Most 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