From c6c54b8d3703cfac0488918ac378203fd08ae7f8 Mon Sep 17 00:00:00 2001 From: Jonathan Rubiero <30461894+rubij@users.noreply.github.com> Date: Fri, 16 Feb 2024 17:48:41 +0100 Subject: [PATCH] [bitnami/mongodb] Added the possibilty to define number of replicas in standalone mode (#22366) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [bitnami/mongodb] Updated values.replicaCount to be 1 Signed-off-by: Jonathan Rubiero <30461894+rubij@users.noreply.github.com> * [bitnami/mongodb] Parametrized replicas setting for standalone mode Signed-off-by: Jonathan Rubiero <30461894+rubij@users.noreply.github.com> * [bitnami/mongodb] Bumped Chart version Signed-off-by: Jonathan Rubiero <30461894+rubij@users.noreply.github.com> * Update README.md with readme-generator-for-helm Signed-off-by: Bitnami Containers * Revert "[bitnami/mongodb] Updated values.replicaCount to be 1" This reverts commit 1c054c2b38234bfe07432c850d6761124c7da562. * [bitnami/mongodb] updated values and dep-sts to limit replicas in standalone mode * Update README.md with readme-generator-for-helm Signed-off-by: Bitnami Containers --------- Signed-off-by: Jonathan Rubiero <30461894+rubij@users.noreply.github.com> Signed-off-by: Bitnami Containers Signed-off-by: Fran de Paz Galán Co-authored-by: Bitnami Containers Co-authored-by: Fran de Paz Galán --- bitnami/mongodb/Chart.yaml | 2 +- bitnami/mongodb/README.md | 2 +- bitnami/mongodb/templates/standalone/dep-sts.yaml | 2 +- bitnami/mongodb/values.yaml | 5 +++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/bitnami/mongodb/Chart.yaml b/bitnami/mongodb/Chart.yaml index c1156e68b4..a0c8b31842 100644 --- a/bitnami/mongodb/Chart.yaml +++ b/bitnami/mongodb/Chart.yaml @@ -39,4 +39,4 @@ maintainers: name: mongodb sources: - https://github.com/bitnami/charts/tree/main/bitnami/mongodb -version: 14.9.0 +version: 14.10.0 diff --git a/bitnami/mongodb/README.md b/bitnami/mongodb/README.md index b670b630bf..45a7644fce 100644 --- a/bitnami/mongodb/README.md +++ b/bitnami/mongodb/README.md @@ -234,7 +234,7 @@ There are no services load balancing requests between MongoDB(®) nodes; inst | --------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- | | `annotations` | Additional labels to be added to the MongoDB(®) statefulset. Evaluated as a template | `{}` | | `labels` | Annotations to be added to the MongoDB(®) statefulset. Evaluated as a template | `{}` | -| `replicaCount` | Number of MongoDB(®) nodes (only when `architecture=replicaset`) | `2` | +| `replicaCount` | Number of MongoDB(®) nodes | `2` | | `updateStrategy.type` | Strategy to use to replace existing MongoDB(®) pods. When architecture=standalone and useStatefulSet=false, | `RollingUpdate` | | `podManagementPolicy` | Pod management policy for MongoDB(®) | `OrderedReady` | | `podAffinityPreset` | MongoDB(®) Pod affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `""` | diff --git a/bitnami/mongodb/templates/standalone/dep-sts.yaml b/bitnami/mongodb/templates/standalone/dep-sts.yaml index d13d6b1744..f7a6ef6f91 100644 --- a/bitnami/mongodb/templates/standalone/dep-sts.yaml +++ b/bitnami/mongodb/templates/standalone/dep-sts.yaml @@ -17,7 +17,7 @@ metadata: annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }} {{- end }} spec: - replicas: 1 + replicas: {{ gt (.Values.replicaCount | int) 1 | ternary 1 .Values.replicaCount }} {{- if .Values.useStatefulSet }} serviceName: {{ include "mongodb.service.nameOverride" . }} {{- end }} diff --git a/bitnami/mongodb/values.yaml b/bitnami/mongodb/values.yaml index b8dffc5cfb..7360b0d1ad 100644 --- a/bitnami/mongodb/values.yaml +++ b/bitnami/mongodb/values.yaml @@ -448,8 +448,9 @@ annotations: {} ## @param labels Annotations to be added to the MongoDB(®) statefulset. Evaluated as a template ## labels: {} -## @param replicaCount Number of MongoDB(®) nodes (only when `architecture=replicaset`) -## Ignored when mongodb.architecture=standalone +## @param replicaCount Number of MongoDB(®) nodes +## When `mongodb.architecture=replicaset`, the number of replicas is taken in account +## When `mongodb.architecture=standalone`, the number of replicas can only be 0 or 1 (value higher then 1 will not be taken in account) ## replicaCount: 2 ## @param updateStrategy.type Strategy to use to replace existing MongoDB(®) pods. When architecture=standalone and useStatefulSet=false,