From aa307a3ada72b4e7fffb2adfcae6bd1c8983d5e2 Mon Sep 17 00:00:00 2001 From: Tuan Anh Nguyen <48820639+tuananhnguyen-ct@users.noreply.github.com> Date: Tue, 17 Mar 2020 21:28:22 +0700 Subject: [PATCH] [stable/mongodb-replicaset] Add support to customize updateStrategy (#20968) * add support to customize updateStrategy Signed-off-by: Tuan Anh Nguyen * minor version bump Signed-off-by: Tuan Anh Nguyen --- stable/mongodb-replicaset/Chart.yaml | 2 +- stable/mongodb-replicaset/README.md | 3 ++- stable/mongodb-replicaset/templates/mongodb-statefulset.yaml | 4 ++++ stable/mongodb-replicaset/values.yaml | 3 +++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/stable/mongodb-replicaset/Chart.yaml b/stable/mongodb-replicaset/Chart.yaml index 8644572aae..dadf17dce3 100644 --- a/stable/mongodb-replicaset/Chart.yaml +++ b/stable/mongodb-replicaset/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 name: mongodb-replicaset home: https://github.com/mongodb/mongo -version: 3.13.1 +version: 3.14.0 appVersion: 3.6 description: NoSQL document-oriented database that stores JSON-like documents with dynamic schemas, simplifying the integration of data in content-driven applications. diff --git a/stable/mongodb-replicaset/README.md b/stable/mongodb-replicaset/README.md index cf84541190..1429a7f24b 100644 --- a/stable/mongodb-replicaset/README.md +++ b/stable/mongodb-replicaset/README.md @@ -38,6 +38,7 @@ The following table lists the configurable parameters of the mongodb chart and t | `replicaSetName` | The name of the replica set | `rs0` | | `skipInitialization` | If `true` skip replica set initialization during bootstrapping | `false` | `podDisruptionBudget` | Pod disruption budget | `{}` | +| `updateStrategy` | Update strategy | `nil` | | `port` | MongoDB port | `27017` | | `imagePullSecrets` | Image pull secrets | `[]` | | `installImage.repository` | Image name for the install container | `unguiculus/mongodb-install` | @@ -406,7 +407,7 @@ metadata: spec: type: ExternalName externalName: mongodb01.mydomain.com -``` +``` If you also put each StatefulSet member behind a loadbalancer the ReplicaSet members outside of the cluster will also be able to reach the pods inside the cluster. diff --git a/stable/mongodb-replicaset/templates/mongodb-statefulset.yaml b/stable/mongodb-replicaset/templates/mongodb-statefulset.yaml index 1f4be0ccdf..3ab6c79a62 100644 --- a/stable/mongodb-replicaset/templates/mongodb-statefulset.yaml +++ b/stable/mongodb-replicaset/templates/mongodb-statefulset.yaml @@ -16,6 +16,10 @@ metadata: name: {{ template "mongodb-replicaset.fullname" . }} namespace: {{ template "mongodb-replicaset.namespace" . }} spec: +{{- if .Values.updateStrategy }} + updateStrategy: +{{ toYaml .Values.updateStrategy | indent 4 }} +{{- end }} selector: matchLabels: app: {{ template "mongodb-replicaset.name" . }} diff --git a/stable/mongodb-replicaset/values.yaml b/stable/mongodb-replicaset/values.yaml index 8056cd628f..eab257dd32 100644 --- a/stable/mongodb-replicaset/values.yaml +++ b/stable/mongodb-replicaset/values.yaml @@ -18,6 +18,9 @@ podDisruptionBudget: {} # maxUnavailable: 1 # minAvailable: 2 +# updateStrategy: + # type: RollingUpdate + auth: enabled: false existingKeySecret: ""