-
Notifications
You must be signed in to change notification settings - Fork 2
fix liveness and readiness probes for webserver #71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -94,10 +94,19 @@ spec: | |||||||||||||||||||||||||||||||||||||||||||||
| command: ["/var/www/html/phing", "-S", "warmup"] | ||||||||||||||||||||||||||||||||||||||||||||||
| preStop: | ||||||||||||||||||||||||||||||||||||||||||||||
| exec: | ||||||||||||||||||||||||||||||||||||||||||||||
| command: | ||||||||||||||||||||||||||||||||||||||||||||||
| - sh | ||||||||||||||||||||||||||||||||||||||||||||||
| - '-c' | ||||||||||||||||||||||||||||||||||||||||||||||
| - sleep 10 && kill -SIGQUIT 1 | ||||||||||||||||||||||||||||||||||||||||||||||
| command: ["/bin/sh","-lc","sleep 10; kill -QUIT 1 || true"] | ||||||||||||||||||||||||||||||||||||||||||||||
| livenessProbe: | ||||||||||||||||||||||||||||||||||||||||||||||
| tcpSocket: | ||||||||||||||||||||||||||||||||||||||||||||||
| port: 9000 | ||||||||||||||||||||||||||||||||||||||||||||||
| initialDelaySeconds: 30 | ||||||||||||||||||||||||||||||||||||||||||||||
| periodSeconds: 10 | ||||||||||||||||||||||||||||||||||||||||||||||
| timeoutSeconds: 2 | ||||||||||||||||||||||||||||||||||||||||||||||
| readinessProbe: | ||||||||||||||||||||||||||||||||||||||||||||||
| tcpSocket: | ||||||||||||||||||||||||||||||||||||||||||||||
| port: 9000 | ||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+99
to
+106
|
||||||||||||||||||||||||||||||||||||||||||||||
| tcpSocket: | |
| port: 9000 | |
| initialDelaySeconds: 30 | |
| periodSeconds: 10 | |
| timeoutSeconds: 2 | |
| readinessProbe: | |
| tcpSocket: | |
| port: 9000 | |
| exec: | |
| command: | |
| - /bin/sh | |
| - -lc | |
| - 'php -r ''$s=@fsockopen("127.0.0.1", 9000, $errno, $errstr, 1); if (!$s) { exit(1); } fclose($s);''' | |
| initialDelaySeconds: 30 | |
| periodSeconds: 10 | |
| timeoutSeconds: 2 | |
| readinessProbe: | |
| exec: | |
| command: | |
| - /bin/sh | |
| - -lc | |
| - 'php -r ''$s=@fsockopen("127.0.0.1", 9000, $errno, $errstr, 1); if (!$s) { exit(1); } fclose($s);''' |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -73,8 +73,15 @@ data: | |||||||||||||||||||||||||||
| root /var/www/html/web; | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| location /health { | ||||||||||||||||||||||||||||
| stub_status on; | ||||||||||||||||||||||||||||
| access_log off; | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| include fastcgi_params; | ||||||||||||||||||||||||||||
| fastcgi_read_timeout 3s; | ||||||||||||||||||||||||||||
| fastcgi_param SCRIPT_FILENAME /ping; | ||||||||||||||||||||||||||||
| fastcgi_param SCRIPT_NAME /ping; | ||||||||||||||||||||||||||||
| fastcgi_param REQUEST_METHOD GET; | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
|
Comment on lines
+77
to
+83
|
||||||||||||||||||||||||||||
| include fastcgi_params; | |
| fastcgi_read_timeout 3s; | |
| fastcgi_param SCRIPT_FILENAME /ping; | |
| fastcgi_param SCRIPT_NAME /ping; | |
| fastcgi_param REQUEST_METHOD GET; | |
| include fastcgi_params; | |
| fastcgi_read_timeout 3s; | |
| fastcgi_param SCRIPT_FILENAME /ping; | |
| fastcgi_param SCRIPT_NAME /ping; | |
| fastcgi_param REQUEST_METHOD GET; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
preStopwas changed to run/bin/sh -lc .... The-l(login shell) flag is unnecessary here and can introduce non-obvious behavior (sourcing profile scripts) or portability issues compared to the rest of the manifests that usesh -c. Using a plain-ckeeps the command consistent and reduces risk.