From 13c55aca8fcafef87740a21549a4314546119c66 Mon Sep 17 00:00:00 2001
From: Jeff Billimek <jeff@billimek.com>
Date: Fri, 29 Mar 2019 05:00:18 -0400
Subject: [PATCH] [stable/node-red] node-red chart enhancements (#12052)

* switching node-red chart to SatefulSet

* based on the persistent nature of this chart as well as [this discussion](https://github.com/helm/charts/issues/1863), migrating the chart to a StatefulSet instead of a deployment. As a result bumping the major version
* bumping node-red docker image to the latest stable version
* using volumeClaimTemplates for statefulSet

Signed-off-by: Jeff Billimek <jeff@billimek.com>

* using Parallel podManagementPolicy

Signed-off-by: Jeff Billimek <jeff@billimek.com>

* revert to Deployment and leverage strategy types

Signed-off-by: Jeff Billimek <jeff@billimek.com>

* hard-code replica count

Signed-off-by: Jeff Billimek <jeff@billimek.com>
---
 stable/node-red/Chart.yaml                | 4 ++--
 stable/node-red/README.md                 | 1 +
 stable/node-red/templates/deployment.yaml | 4 +++-
 stable/node-red/values.yaml               | 5 +++--
 4 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/stable/node-red/Chart.yaml b/stable/node-red/Chart.yaml
index e75d37bd7..6eba71855 100644
--- a/stable/node-red/Chart.yaml
+++ b/stable/node-red/Chart.yaml
@@ -1,8 +1,8 @@
 apiVersion: v1
-appVersion: 0.19.4
+appVersion: 0.19.6
 description: Node-RED is flow-based programming for the Internet of Things
 name: node-red
-version: 1.1.0
+version: 1.2.0
 keywords:
   - nodered
   - node-red
diff --git a/stable/node-red/README.md b/stable/node-red/README.md
index 4752163f1..e4927fae1 100644
--- a/stable/node-red/README.md
+++ b/stable/node-red/README.md
@@ -41,6 +41,7 @@ The following tables lists the configurable parameters of the Sentry chart and t
 | `image.repository`                   | node-red image                             | `nodered/node-red-docker` |
 | `image.tag`                          | node-red image tag                         | `0.19.4-v8` |
 | `image.pullPolicy`                   | node-red image pull policy                 | `IfNotPresent` |
+| `strategyType`                       | Specifies the strategy used to replace old Pods by new ones | `Recreate` |
 | `flows`                              | Default flows configuration                | `flows.json` |
 | `nodeOptions`                        | Node.js runtime arguments                  | `` |
 | `timezone`                           | Default timezone                           | `UTC` |
diff --git a/stable/node-red/templates/deployment.yaml b/stable/node-red/templates/deployment.yaml
index 3ca62e625..576694f7b 100644
--- a/stable/node-red/templates/deployment.yaml
+++ b/stable/node-red/templates/deployment.yaml
@@ -8,7 +8,9 @@ metadata:
     app.kubernetes.io/instance: {{ .Release.Name }}
     app.kubernetes.io/managed-by: {{ .Release.Service }}
 spec:
-  replicas: {{ .Values.replicaCount }}
+  replicas: 1
+  strategy:
+    type: {{ .Values.strategyType }}
   selector:
     matchLabels:
       app.kubernetes.io/name: {{ include "node-red.name" . }}
diff --git a/stable/node-red/values.yaml b/stable/node-red/values.yaml
index a097667f6..313300075 100644
--- a/stable/node-red/values.yaml
+++ b/stable/node-red/values.yaml
@@ -2,11 +2,12 @@
 # This is a YAML-formatted file.
 # Declare variables to be passed into your templates.
 
-replicaCount: 1
+# upgrade strategy type (e.g. Recreate or RollingUpdate)
+strategyType: Recreate
 
 image:
   repository: nodered/node-red-docker
-  tag: 0.19.4-v8
+  tag: 0.19.6-v8
   pullPolicy: IfNotPresent
 
 nameOverride: ""