[node-red] Add startupProbe (#147)

* Add startupProbe to Node-RED chart in order to address slow starting container being killed due to liveness probe failures.

* Bump node-red chart version

* Update version to reflect new feature.

* Paramaterisation of liveness, readiness and startup probe configuration.

Configure startup probe to disabled by default.

Co-authored-by: Jeff Billimek <jeff@billimek.com>
This commit is contained in:
coldfire84 2020-11-14 17:29:03 +00:00 committed by GitHub
parent 0ec462c58e
commit 4cfc8fc0db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 98 additions and 45 deletions

View File

@ -2,7 +2,7 @@ apiVersion: v2
appVersion: 1.0.6-12 appVersion: 1.0.6-12
description: Node-RED is low-code programming for event-driven applications description: Node-RED is low-code programming for event-driven applications
name: node-red name: node-red
version: 3.1.0 version: 3.2.0
keywords: keywords:
- nodered - nodered
- node-red - node-red

View File

@ -37,14 +37,26 @@ The command removes all the Kubernetes components associated with the chart and
The following tables lists the configurable parameters of the Node-RED chart and their default values. The following tables lists the configurable parameters of the Node-RED chart and their default values.
| Parameter | Description | Default | | Parameter | Description | Default |
|:---------------------------------- |:----------------------------------------------------------------------- |:------------------------- | |:------------------------------------- |:----------------------------------------------------------------------- |:------------------------- |
| `image.repository` | node-red image | `nodered/node-red` | | `image.repository` | node-red image | `nodered/node-red` |
| `image.tag` | node-red image tag | `1.0.6-12-minimal` | | `image.tag` | node-red image tag | `1.0.6-12-minimal` |
| `image.pullPolicy` | node-red image pull policy | `IfNotPresent` | | `image.pullPolicy` | node-red image pull policy | `IfNotPresent` |
| `strategyType` | Specifies the strategy used to replace old Pods by new ones | `Recreate` | | `strategyType` | Specifies the strategy used to replace old Pods by new ones | `Recreate` |
| `serviceAccountName` | Service account to run the pod as | `` | | `serviceAccountName` | Service account to run the pod as | `` |
| `livenessProbePath` | Default livenessProbe path | `/` | | `probes.liveness.enabled` | Enable/ disable livenessProbe | `true` |
| `readinessProbePath` | Default readinessProbe path | `/` | | `probes.liveness.probePath` | Set livenessProbe path | `/` |
| `probes.liveness.initialDelaySeconds` | Set livenessProbe initial delay | 60 |
| `probes.liveness.failureThreshold` | Set livenessProbe failure threshold | 5 |
| `probes.liveness.timeoutSeconds` | Set livenessProbe timeout | 10 |
| `probes.readiness.enabled` | Enable/ disable readinessProbe | `true` |
| `probes.readiness.probePath` | Set readinessProbe path | `/` |
| `probes.readiness.initialDelaySeconds`| Set readinessProbe initial delay | 60 |
| `probes.readiness.failureThreshold` | Set readinessProbe failure threshold | 5 |
| `probes.readiness.timeoutSeconds` | Set readinessProbe timeout | 10 |
| `probes.startup.enabled` | Enable/ disable readinessProbe | `false` |
| `probes.startup.probePath` | Set startupProbe path | `/` |
| `probes.startup.failureThreshold` | Set startupProbe failure threshold | 30 |
| `probes.startup.periodSeconds` | Set startupProbe period | 10 |
| `flows` | Default flows configuration | `flows.json` | | `flows` | Default flows configuration | `flows.json` |
| `safeMode` | Setting to true starts Node-RED in safe (not running) mode | `false` | | `safeMode` | Setting to true starts Node-RED in safe (not running) mode | `false` |
| `enableProjects` | setting to true starts Node-RED with the projects feature enabled | `false` | | `enableProjects` | setting to true starts Node-RED with the projects feature enabled | `false` |

View File

@ -44,14 +44,32 @@ spec:
- name: http - name: http
containerPort: 1880 containerPort: 1880
protocol: TCP protocol: TCP
{{- if .Values.probes.liveness.enabled }}
livenessProbe: livenessProbe:
httpGet: httpGet:
path: {{ .Values.livenessProbePath }} path: {{ .Values.probes.liveness.probePath }}
port: http port: http
initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }}
failureThreshold: {{ .Values.probes.liveness.failureThreshold }}
timeoutSeconds: {{ .Values.probes.liveness.timeoutSeconds }}
{{- end }}
{{- if .Values.probes.readiness.enabled }}
readinessProbe: readinessProbe:
httpGet: httpGet:
path: {{ .Values.readinessProbePath }} path: {{ .Values.probes.readiness.probePath }}
port: http port: http
initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }}
failureThreshold: {{ .Values.probes.readiness.failureThreshold }}
timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }}
{{- end }}
{{- if .Values.probes.startup.enabled }}
startupProbe:
httpGet:
path: {{ .Values.probes.startup.probePath }}
port: http
failureThreshold: {{ .Values.probes.startup.failureThreshold }}
periodSeconds: {{ .Values.probes.startup.periodSeconds }}
{{- end }}
env: env:
- name: FLOWS - name: FLOWS
value: "{{ .Values.flows }}" value: "{{ .Values.flows }}"

View File

@ -15,8 +15,31 @@ fullnameOverride: ""
serviceAccountName: "" serviceAccountName: ""
livenessProbePath: / # Probes configuration
readinessProbePath: / # ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes
probes:
liveness:
# Indicates whether the container is running. If the liveness probe fails, the kubelet kills the container
# and the container is subjected to its restart policy.
enabled: true
probePath: /
initialDelaySeconds: 60
failureThreshold: 5
timeoutSeconds: 10
readiness:
# Indicates whether the container is ready to respond to requests.
enabled: true
probePath: /
initialDelaySeconds: 60
failureThreshold: 5
timeoutSeconds: 10
startup:
# Indicates whether the application within the container is started.
# All other probes are disabled if a startup probe is provided, until it succeeds.
enabled: false
probePath: /
failureThreshold: 30
periodSeconds: 10
flows: "flows.json" flows: "flows.json"
safeMode: "false" safeMode: "false"