[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

@ -36,46 +36,58 @@ 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 | `/` |
| `flows` | Default flows configuration | `flows.json` | | `probes.liveness.initialDelaySeconds` | Set livenessProbe initial delay | 60 |
| `safeMode` | Setting to true starts Node-RED in safe (not running) mode | `false` | | `probes.liveness.failureThreshold` | Set livenessProbe failure threshold | 5 |
| `enableProjects` | setting to true starts Node-RED with the projects feature enabled | `false` | | `probes.liveness.timeoutSeconds` | Set livenessProbe timeout | 10 |
| `nodeOptions` | Node.js runtime arguments | `` | | `probes.readiness.enabled` | Enable/ disable readinessProbe | `true` |
| `extraEnvs` | Extra environment variables which will be appended to the env | `[]` | | `probes.readiness.probePath` | Set readinessProbe path | `/` |
| `timezone` | Default timezone | `UTC` | | `probes.readiness.initialDelaySeconds`| Set readinessProbe initial delay | 60 |
| `service.type` | Kubernetes service type for the GUI | `ClusterIP` | | `probes.readiness.failureThreshold` | Set readinessProbe failure threshold | 5 |
| `service.port` | Kubernetes port where the GUI is exposed | `1880` | | `probes.readiness.timeoutSeconds` | Set readinessProbe timeout | 10 |
| `service.nodePort` | Kubernetes nodePort where the GUI is exposed | `` | | `probes.startup.enabled` | Enable/ disable readinessProbe | `false` |
| `service.annotations` | Service annotations for the GUI | `{}` | | `probes.startup.probePath` | Set startupProbe path | `/` |
| `service.labels` | Custom labels | `{}` | | `probes.startup.failureThreshold` | Set startupProbe failure threshold | 30 |
| `service.loadBalancerIP` | Loadbalance IP for the GUI | `{}` | | `probes.startup.periodSeconds` | Set startupProbe period | 10 |
| `service.loadBalancerSourceRanges` | List of IP CIDRs allowed access to load balancer (if supported) | None | | `flows` | Default flows configuration | `flows.json` |
| `service.externalTrafficPolicy` | Set the externalTrafficPolicy in the Service to either Cluster or Local | `Cluster` | | `safeMode` | Setting to true starts Node-RED in safe (not running) mode | `false` |
| `ingress.enabled` | Enables Ingress | `false` | | `enableProjects` | setting to true starts Node-RED with the projects feature enabled | `false` |
| `ingress.annotations` | Ingress annotations | `{}` | | `nodeOptions` | Node.js runtime arguments | `` |
| `ingress.path` | Ingress path | `/` | | `extraEnvs` | Extra environment variables which will be appended to the env | `[]` |
| `ingress.hosts` | Ingress accepted hostnames | `chart-example.local` | | `timezone` | Default timezone | `UTC` |
| `ingress.tls` | Ingress TLS configuration | `[]` | | `service.type` | Kubernetes service type for the GUI | `ClusterIP` |
| `persistence.enabled` | Use persistent volume to store data | `false` | | `service.port` | Kubernetes port where the GUI is exposed | `1880` |
| `persistence.size` | Size of persistent volume claim | `5Gi` | | `service.nodePort` | Kubernetes nodePort where the GUI is exposed | `` |
| `persistence.existingClaim` | Use an existing PVC to persist data | `nil` | | `service.annotations` | Service annotations for the GUI | `{}` |
| `persistence.storageClass` | Type of persistent volume claim | `-` | | `service.labels` | Custom labels | `{}` |
| `persistence.accessModes` | Persistence access modes | `ReadWriteOnce` | | `service.loadBalancerIP` | Loadbalance IP for the GUI | `{}` |
| `persistence.subPath` | Mount a sub dir of the persistent volume | `nil` | | `service.loadBalancerSourceRanges` | List of IP CIDRs allowed access to load balancer (if supported) | None |
| `resources` | CPU/Memory resource requests/limits | `{}` | | `service.externalTrafficPolicy` | Set the externalTrafficPolicy in the Service to either Cluster or Local | `Cluster` |
| `nodeSelector` | Node labels for pod assignment | `{}` | | `ingress.enabled` | Enables Ingress | `false` |
| `tolerations` | Toleration labels for pod assignment | `[]` | | `ingress.annotations` | Ingress annotations | `{}` |
| `affinity` | Affinity settings for pod assignment | `{}` | | `ingress.path` | Ingress path | `/` |
| `podAnnotations` | Key-value pairs to add as pod annotations | `{}` | | `ingress.hosts` | Ingress accepted hostnames | `chart-example.local` |
| `deploymentAnnotations` | Key-value pairs to add as deployment annotations | `{}` | | `ingress.tls` | Ingress TLS configuration | `[]` |
| `persistence.enabled` | Use persistent volume to store data | `false` |
| `persistence.size` | Size of persistent volume claim | `5Gi` |
| `persistence.existingClaim` | Use an existing PVC to persist data | `nil` |
| `persistence.storageClass` | Type of persistent volume claim | `-` |
| `persistence.accessModes` | Persistence access modes | `ReadWriteOnce` |
| `persistence.subPath` | Mount a sub dir of the persistent volume | `nil` |
| `resources` | CPU/Memory resource requests/limits | `{}` |
| `nodeSelector` | Node labels for pod assignment | `{}` |
| `tolerations` | Toleration labels for pod assignment | `[]` |
| `affinity` | Affinity settings for pod assignment | `{}` |
| `podAnnotations` | Key-value pairs to add as pod annotations | `{}` |
| `deploymentAnnotations` | Key-value pairs to add as deployment annotations | `{}` |
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,

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"