Skip to content

Commit 0ce63a2

Browse files
authored
feat(helm): Add probes and nginx rules (#146)
* feat(helm): Add probes and nginx rules * feat(helm): Add probes and nginx rules
1 parent 0bd9ce5 commit 0ce63a2

File tree

8 files changed

+94
-15
lines changed

8 files changed

+94
-15
lines changed

charts/drupal/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: drupal
22
apiVersion: v2
33
type: application
4-
version: 1.0.0-beta7
4+
version: 1.0.0-beta8
55
appVersion: 5.2.3
66
description: Drupal 10 variant of the Web Experience Toolkit (WxT).
77
keywords:

charts/drupal/README.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# drupal
22

3-
![Version: 1.0.0-beta7](https://img.shields.io/badge/Version-1.0.0--beta7-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 5.2.0](https://img.shields.io/badge/AppVersion-5.2.0-informational?style=flat-square)
3+
![Version: 1.0.0-beta8](https://img.shields.io/badge/Version-1.0.0--beta8-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 5.2.3](https://img.shields.io/badge/AppVersion-5.2.3-informational?style=flat-square)
44

55
Drupal 10 variant of the Web Experience Toolkit (WxT).
66

@@ -98,6 +98,18 @@ helm install --name drupal -f values-<override>.yaml
9898
| drupal.extensions.enabled | bool | `true` | |
9999
| drupal.extraSettings | string | `""` | |
100100
| drupal.healthcheck.enabled | bool | `true` | |
101+
| drupal.healthcheck.probes.livenessProbe.exec.command[0] | string | `"php-fpm-healthcheck"` | |
102+
| drupal.healthcheck.probes.livenessProbe.failureThreshold | int | `3` | |
103+
| drupal.healthcheck.probes.livenessProbe.initialDelaySeconds | int | `1` | |
104+
| drupal.healthcheck.probes.livenessProbe.periodSeconds | int | `5` | |
105+
| drupal.healthcheck.probes.livenessProbe.successThreshold | int | `1` | |
106+
| drupal.healthcheck.probes.livenessProbe.timeoutSeconds | int | `1` | |
107+
| drupal.healthcheck.probes.readinessProbe.exec.command[0] | string | `"php-fpm-healthcheck"` | |
108+
| drupal.healthcheck.probes.readinessProbe.failureThreshold | int | `3` | |
109+
| drupal.healthcheck.probes.readinessProbe.initialDelaySeconds | int | `1` | |
110+
| drupal.healthcheck.probes.readinessProbe.periodSeconds | int | `5` | |
111+
| drupal.healthcheck.probes.readinessProbe.successThreshold | int | `1` | |
112+
| drupal.healthcheck.probes.readinessProbe.timeoutSeconds | int | `1` | |
101113
| drupal.image | string | `"drupalwxt/site-wxt"` | |
102114
| drupal.imagePullPolicy | string | `"IfNotPresent"` | |
103115
| drupal.install | bool | `true` | |
@@ -163,6 +175,21 @@ helm install --name drupal -f values-<override>.yaml
163175
| nginx.client_max_body_size | string | `"20m"` | |
164176
| nginx.customLocations | string | `""` | |
165177
| nginx.gzip | bool | `true` | |
178+
| nginx.healthcheck.enabled | bool | `true` | |
179+
| nginx.healthcheck.livenessProbe.failureThreshold | int | `3` | |
180+
| nginx.healthcheck.livenessProbe.httpGet.path | string | `"/_healthz"` | |
181+
| nginx.healthcheck.livenessProbe.httpGet.port | int | `8080` | |
182+
| nginx.healthcheck.livenessProbe.initialDelaySeconds | int | `1` | |
183+
| nginx.healthcheck.livenessProbe.periodSeconds | int | `5` | |
184+
| nginx.healthcheck.livenessProbe.successThreshold | int | `1` | |
185+
| nginx.healthcheck.livenessProbe.timeoutSeconds | int | `1` | |
186+
| nginx.healthcheck.readinessProbe.failureThreshold | int | `3` | |
187+
| nginx.healthcheck.readinessProbe.httpGet.path | string | `"/_healthz"` | |
188+
| nginx.healthcheck.readinessProbe.httpGet.port | int | `8080` | |
189+
| nginx.healthcheck.readinessProbe.initialDelaySeconds | int | `1` | |
190+
| nginx.healthcheck.readinessProbe.periodSeconds | int | `5` | |
191+
| nginx.healthcheck.readinessProbe.successThreshold | int | `1` | |
192+
| nginx.healthcheck.readinessProbe.timeoutSeconds | int | `1` | |
166193
| nginx.image | string | `"drupalwxt/site-wxt"` | |
167194
| nginx.imagePullPolicy | string | `"IfNotPresent"` | |
168195
| nginx.nodeSelector | object | `{}` | |

charts/drupal/conf/nginx.conf

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,14 @@ http {
4646
#IPv6
4747
listen [::]:8080;
4848

49-
# Filesystem root of the site and index with fallback.
49+
# Filesystem root of the site and index with fallback
5050
{{- if not (eq .Values.drupal.siteRoot "/") }}
5151
root /webroot;
5252
{{- else }}
5353
root /var/www/html;
5454
{{- end }}
5555
index index.php index.html index.htm;
56-
57-
# Make site accessible from http://drupal.dev;
5856
server_name _;
59-
6057
set_real_ip_from 0.0.0.0/0;
6158
real_ip_header {{ .Values.nginx.real_ip_header }};
6259

@@ -71,18 +68,21 @@ http {
7168
return 200 "OK";
7269
}
7370

71+
# Root location
7472
location / {
7573
# First attempt to serve request as file, then
76-
# as directory, then fall back to displaying a 404.
74+
# as directory, then fall back to displaying a 404
7775
{{- if not (eq .Values.drupal.siteRoot "/") }}
7876
try_files $uri $uri/ /index.html {{ .Values.drupal.siteRoot }}/index.php?$query_string;
7977
{{- else }}
8078
try_files $uri $uri/ /index.html /index.php?$query_string;
8179
{{- end }}
80+
{{- if .Values.nginx.rootLocationRules }}
81+
{{ tpl .Values.nginx.rootLocationRules . | nindent 10 }}
82+
{{- end }}
8283
}
8384

84-
{{ .Values.nginx.customLocations }}
85-
85+
# Handles PHP requests
8686
location ~ \.php$ {
8787
proxy_intercept_errors on;
8888
include fastcgi_params;
@@ -96,8 +96,11 @@ http {
9696
try_files $uri =404;
9797
}
9898

99+
# Block restricted files and directories
99100
location ~ /\.ht {
100101
deny all;
101102
}
103+
104+
{{ .Values.nginx.customLocations }}
102105
}
103106
}

charts/drupal/templates/deploy/drupal.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,14 @@ spec:
5656
name: tcp-php-fpm
5757
protocol: TCP
5858
{{- if .Values.drupal.healthcheck.enabled }}
59+
{{- if .Values.drupal.healthcheck.probes }}
60+
{{- toYaml .Values.drupal.healthcheck.probes | nindent 8 }}
61+
{{- else }}
5962
livenessProbe:
6063
exec:
6164
command:
6265
- php-fpm-healthcheck
63-
initialDelaySeconds: 0
66+
initialDelaySeconds: 1
6467
periodSeconds: 5
6568
readinessProbe:
6669
exec:
@@ -69,6 +72,7 @@ spec:
6972
initialDelaySeconds: 1
7073
periodSeconds: 5
7174
{{- end }}
75+
{{- end }}
7276
env:
7377
{{- include "drupal.env" . | nindent 10 }}
7478
{{- if .Values.extraEnvVars }}

charts/drupal/values.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,25 @@ drupal:
259259
# Requires https://github.com/renatomefi/php-fpm-healthcheck in the container.
260260
healthcheck:
261261
enabled: true
262+
probes:
263+
livenessProbe:
264+
exec:
265+
command:
266+
- php-fpm-healthcheck
267+
initialDelaySeconds: 1
268+
periodSeconds: 5
269+
timeoutSeconds: 1
270+
successThreshold: 1
271+
failureThreshold: 3
272+
readinessProbe:
273+
exec:
274+
command:
275+
- php-fpm-healthcheck
276+
initialDelaySeconds: 1
277+
periodSeconds: 5
278+
timeoutSeconds: 1
279+
successThreshold: 1
280+
failureThreshold: 3
262281

263282
# Enable all of the WxT extension modules
264283
extensions:
@@ -417,6 +436,31 @@ nginx:
417436

418437
serviceType: ClusterIP
419438

439+
healthcheck:
440+
enabled: true
441+
livenessProbe:
442+
httpGet:
443+
path: /_healthz
444+
port: 8080
445+
initialDelaySeconds: 1
446+
periodSeconds: 5
447+
timeoutSeconds: 1
448+
successThreshold: 1
449+
failureThreshold: 3
450+
readinessProbe:
451+
httpGet:
452+
path: /_healthz
453+
port: 8080
454+
initialDelaySeconds: 1
455+
periodSeconds: 5
456+
timeoutSeconds: 1
457+
successThreshold: 1
458+
failureThreshold: 3
459+
460+
# rootLocationRules: |
461+
# deny 5.181.182.0/24;
462+
# allow all;
463+
420464
customLocations: ""
421465

422466
volumes:

charts/solr/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 0.1.9
18+
version: 0.1.10
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to

charts/solr/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# solr
22

3-
![Version: 0.1.9](https://img.shields.io/badge/Version-0.1.9-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 8.11.3](https://img.shields.io/badge/AppVersion-8.11.3-informational?style=flat-square)
3+
![Version: 0.1.10](https://img.shields.io/badge/Version-0.1.10-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 8.11.3](https://img.shields.io/badge/AppVersion-8.11.3-informational?style=flat-square)
44

55
A Helm chart for a Solr instance using the official Solr Operator.
66

charts/solr/values.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,11 @@ solr:
3030
# timeoutSeconds: 5
3131
# resources:
3232
# limits:
33-
# memory: 5Gi
33+
# memory: "5Gi"
3434
# requests:
35-
# cpu: 250m
36-
# memory: 256Mi
35+
# cpu: "250m"
36+
# memory: "256Mi"
37+
3738
storage:
3839
size: 5Gi
3940

0 commit comments

Comments
 (0)