diff --git a/sickhub/nginx-phpfpm/Chart.yaml b/sickhub/nginx-phpfpm/Chart.yaml index a9c74b7..8d01eef 100644 --- a/sickhub/nginx-phpfpm/Chart.yaml +++ b/sickhub/nginx-phpfpm/Chart.yaml @@ -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 diff --git a/sickhub/nginx-phpfpm/README.md b/sickhub/nginx-phpfpm/README.md index 80a110e..2a7f59e 100644 --- a/sickhub/nginx-phpfpm/README.md +++ b/sickhub/nginx-phpfpm/README.md @@ -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` @@ -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: @@ -78,7 +79,9 @@ configMaps: scripts: path: / data: - health.php: | + livez.html: | + OK + healthz.php: | configs: path: /etc @@ -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 ``` diff --git a/sickhub/nginx-phpfpm/templates/nginx-config.yaml b/sickhub/nginx-phpfpm/templates/nginx-config.yaml index a5ddf92..280ff00 100644 --- a/sickhub/nginx-phpfpm/templates/nginx-config.yaml +++ b/sickhub/nginx-phpfpm/templates/nginx-config.yaml @@ -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 / { diff --git a/sickhub/nginx-phpfpm/values.yaml b/sickhub/nginx-phpfpm/values.yaml index 24cce5a..0aecf25 100644 --- a/sickhub/nginx-phpfpm/values.yaml +++ b/sickhub/nginx-phpfpm/values.yaml @@ -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"