Skip to content

Commit

Permalink
update probe references everywhere (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
DrPsychick committed Mar 18, 2023
1 parent 9386f35 commit 8e28a95
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion sickhub/nginx-phpfpm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: nginx-phpfpm
description: A chart for an nginx pod with multiple phpfpm pods
type: application
version: 0.1.0
version: 0.1.1
appVersion: "8-fpm-alpine"
home: https://github.com/SickHub
icon: https://raw.githubusercontent.com/SickHub/charts/master/sickhub/nginx-phpfpm/icon.png
Expand Down
12 changes: 8 additions & 4 deletions sickhub/nginx-phpfpm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ ingress:
```
### Nginx
* uses `/health.php` as an health endpoint by default (e.g. expects that to exist on the `phpfpm` image)
* the path `/health.php` is only accessible from within the cluster.
* uses `/healthz.php` and `/livez.html` as an readiness and liveness probes by default (e.g. expects that to exist on the `phpfpm` image)
* the path `/healthz.php` is only accessible from within the cluster.
* [ ] TODO: the `nginx.conf` can be provided in the `values.yaml`
* access can be restricted with simple basic auth through `nginx.htaccess`

Expand All @@ -48,7 +48,8 @@ You have multiple options to run your code:
* add simple scripts to your `values.yaml` to run on a generic image

Requirements:
* image must include `/health.php` used by health check of `nginx`
* image must include `/healthz.php` and `/livez.html` used by probes of `nginx`.
* add `/livez.html` to `phpfpm.staticFiles` so that it is copied to the nginx docroot.

#### Use your own PHP FPM image
Create your own image including your code:
Expand Down Expand Up @@ -78,7 +79,9 @@ configMaps:
scripts:
path: /
data:
health.php: |
livez.html: |
<html><body>OK</body></html>
healthz.php: |
<?php phpinfo(); ?>
configs:
path: /etc
Expand All @@ -96,6 +99,7 @@ to copy static files from the `phpfpm` image to the document root of `nginx` to
```yaml
phpfpm:
staticFiles:
- livez.html
- *.jpg
- assets
```
Expand Down
4 changes: 2 additions & 2 deletions sickhub/nginx-phpfpm/templates/nginx-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ data:
# Set nginx to serve files from the shared volume!
root {{ .Values.nginx.docRoot }};
server_name _;
location /health.php {
location /healthz.php {
satisfy all;
allow 10.0.0.0/8;
deny all;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root/health.php;
fastcgi_param SCRIPT_FILENAME $document_root/healthz.php;
fastcgi_pass {{ include "nginx-phpfpm.fullname" . }}-phpfpm:9000;
}
location / {
Expand Down
1 change: 1 addition & 0 deletions sickhub/nginx-phpfpm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ phpfpm:
# these directories or files are copied to `docRoot` of nginx from the phpfpm image
# mutually exclusive with `persistence.enabled = true`
staticFiles: []
# - "livez.html"
# - "*.jpg"
# - "assets"

Expand Down

0 comments on commit 8e28a95

Please sign in to comment.