From 6c1ce79e1f9dcd194f101ee60b85fd41b16971f2 Mon Sep 17 00:00:00 2001 From: Miguel Ruiz Date: Thu, 27 Feb 2025 11:13:28 +0100 Subject: [PATCH] [bitnami/mongodb-sharded] Set `usePasswordFiles=true` by default (#32112) * [bitnami/mongodb-sharded] Set `usePasswordFiles=true` by default Signed-off-by: Miguel Ruiz * Update CHANGELOG.md Signed-off-by: Bitnami Containers * Update README.md with readme-generator-for-helm Signed-off-by: Bitnami Containers * Update CHANGELOG.md Signed-off-by: Bitnami Containers --------- Signed-off-by: Miguel Ruiz Signed-off-by: Bitnami Containers Co-authored-by: Bitnami Containers --- bitnami/mongodb-sharded/CHANGELOG.md | 9 +++++++-- bitnami/mongodb-sharded/Chart.yaml | 2 +- bitnami/mongodb-sharded/README.md | 2 +- .../config-server/config-server-statefulset.yaml | 16 ++++++++-------- .../templates/mongos/mongos-dep-sts.yaml | 12 ++++++------ .../replicaset-entrypoint-configmap.yaml | 2 +- .../shard/shard-arbiter-statefulset.yaml | 12 ++++++------ .../templates/shard/shard-data-statefulset.yaml | 16 ++++++++-------- bitnami/mongodb-sharded/values.yaml | 4 ++-- 9 files changed, 40 insertions(+), 35 deletions(-) diff --git a/bitnami/mongodb-sharded/CHANGELOG.md b/bitnami/mongodb-sharded/CHANGELOG.md index 8cd5a9927f..e0993b0d50 100644 --- a/bitnami/mongodb-sharded/CHANGELOG.md +++ b/bitnami/mongodb-sharded/CHANGELOG.md @@ -1,8 +1,13 @@ # Changelog -## 9.1.3 (2025-02-21) +## 9.2.0 (2025-02-26) -* [bitnami/mongodb-sharded] Release 9.1.3 ([#32134](https://github.com/bitnami/charts/pull/32134)) +* [bitnami/mongodb-sharded] Set `usePasswordFiles=true` by default ([#32112](https://github.com/bitnami/charts/pull/32112)) + +## 9.1.3 (2025-02-21) + +* [bitnami/*] Use CDN url for the Bitnami Application Icons (#31881) ([d9bb11a](https://github.com/bitnami/charts/commit/d9bb11a9076b9bfdcc70ea022c25ef50e9713657)), closes [#31881](https://github.com/bitnami/charts/issues/31881) +* [bitnami/mongodb-sharded] Release 9.1.3 (#32134) ([65a30fa](https://github.com/bitnami/charts/commit/65a30fab023ed5b9d85d9bf80b435237c7a04226)), closes [#32134](https://github.com/bitnami/charts/issues/32134) ## 9.1.2 (2025-02-03) diff --git a/bitnami/mongodb-sharded/Chart.yaml b/bitnami/mongodb-sharded/Chart.yaml index a979561c41..3eda0411f6 100644 --- a/bitnami/mongodb-sharded/Chart.yaml +++ b/bitnami/mongodb-sharded/Chart.yaml @@ -35,4 +35,4 @@ maintainers: name: mongodb-sharded sources: - https://github.com/bitnami/charts/tree/main/bitnami/mongodb-sharded -version: 9.1.3 +version: 9.2.0 diff --git a/bitnami/mongodb-sharded/README.md b/bitnami/mongodb-sharded/README.md index 00616579aa..4b8bee22b9 100644 --- a/bitnami/mongodb-sharded/README.md +++ b/bitnami/mongodb-sharded/README.md @@ -222,7 +222,7 @@ The Bitnami Kibana chart supports mounting extra volumes (either PVCs, secrets o | `auth.rootPassword` | MongoDB(®) root password | `""` | | `auth.replicaSetKey` | Key used for authentication in the replicaset | `""` | | `auth.existingSecret` | Existing secret with MongoDB(®) credentials (keys: `mongodb-password`, `mongodb-root-password`, `mongodb-replica-set-key`) | `""` | -| `auth.usePasswordFile` | Mount credentials as files instead of using environment variables | `false` | +| `auth.usePasswordFiles` | Mount credentials as files instead of using environment variables | `true` | | `shards` | Number of shards to be created | `2` | | `common.mongodbEnableNumactl` | Enable launch MongoDB instance prefixed with "numactl --interleave=all" | `false` | | `common.useHostnames` | Enable DNS hostnames in the replica set config | `true` | diff --git a/bitnami/mongodb-sharded/templates/config-server/config-server-statefulset.yaml b/bitnami/mongodb-sharded/templates/config-server/config-server-statefulset.yaml index 206df96e1b..d9a78d664d 100644 --- a/bitnami/mongodb-sharded/templates/config-server/config-server-statefulset.yaml +++ b/bitnami/mongodb-sharded/templates/config-server/config-server-statefulset.yaml @@ -155,7 +155,7 @@ spec: {{- if .Values.auth.enabled }} - name: MONGODB_ROOT_USER value: {{ .Values.auth.rootUser | quote }} - {{- if .Values.auth.usePasswordFile }} + {{- if .Values.auth.usePasswordFiles }} - name: MONGODB_ROOT_PASSWORD_FILE value: "/bitnami/mongodb/secrets/mongodb-root-password" - name: MONGODB_REPLICA_SET_KEY_FILE @@ -239,8 +239,8 @@ spec: readinessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.configsvr.readinessProbe "enabled") "context" $) | nindent 12 }} exec: command: - - /bin/sh - - -c + - /bin/sh + - -c - mongosh --port $MONGODB_PORT_NUMBER --eval "db.adminCommand('ping')" {{- end }} {{- if .Values.configsvr.customStartupProbe }} @@ -281,7 +281,7 @@ spec: - name: config mountPath: /bitnami/mongodb/conf/ {{- end }} - {{- if .Values.auth.usePasswordFile }} + {{- if .Values.auth.usePasswordFiles }} - name: secrets mountPath: /bitnami/mongodb/secrets/ {{- end }} @@ -315,7 +315,7 @@ spec: {{- if .Values.auth.enabled }} - name: MONGODB_ROOT_USER value: {{ .Values.auth.rootUser | quote }} - {{- if .Values.auth.usePasswordFile }} + {{- if .Values.auth.usePasswordFiles }} - name: MONGODB_ROOT_PASSWORD_FILE value: "/bitnami/mongodb/secrets/mongodb-root-password" {{- else }} @@ -335,7 +335,7 @@ spec: - -ec - |- #!/bin/sh - {{- if .Values.auth.usePasswordFile }} + {{- if .Values.auth.usePasswordFiles }} export MONGODB_ROOT_PASSWORD="$(cat "${MONGODB_ROOT_PASSWORD_FILE}")" {{- end }} /bin/mongodb_exporter --collect-all --compatible-mode --web.listen-address ":{{ .Values.metrics.containerPorts.metrics }}" --mongodb.uri mongodb://$(echo $MONGODB_ROOT_USER):$(echo $MONGODB_ROOT_PASSWORD | sed -r "s/@/%40/g;s/:/%3A/g")@localhost:{{ .Values.common.containerPorts.mongodb }}/admin{{ ternary "?ssl=true" "" $.Values.metrics.useTLS }} {{ .Values.metrics.extraArgs }} @@ -344,7 +344,7 @@ spec: - name: empty-dir mountPath: /tmp subPath: tmp-dir - {{- if .Values.auth.usePasswordFile }} + {{- if .Values.auth.usePasswordFiles }} - name: secrets mountPath: /bitnami/mongodb/secrets/ {{- end }} @@ -393,7 +393,7 @@ spec: - name: replicaset-entrypoint-configmap configMap: name: {{ printf "%s-replicaset-entrypoint" (include "common.names.fullname" .) }} - {{- if .Values.auth.usePasswordFile }} + {{- if .Values.auth.usePasswordFiles }} - name: secrets secret: secretName: {{ include "mongodb-sharded.secret" . }} diff --git a/bitnami/mongodb-sharded/templates/mongos/mongos-dep-sts.yaml b/bitnami/mongodb-sharded/templates/mongos/mongos-dep-sts.yaml index b5465b9d2f..3d6a01cd3d 100644 --- a/bitnami/mongodb-sharded/templates/mongos/mongos-dep-sts.yaml +++ b/bitnami/mongodb-sharded/templates/mongos/mongos-dep-sts.yaml @@ -107,7 +107,7 @@ spec: {{- if $.Values.auth.enabled }} - name: MONGODB_ROOT_USER value: {{ .Values.auth.rootUser | quote }} - {{- if .Values.auth.usePasswordFile }} + {{- if .Values.auth.usePasswordFiles }} - name: MONGODB_ROOT_PASSWORD_FILE value: "/bitnami/mongodb/secrets/mongodb-root-password" - name: MONGODB_REPLICA_SET_KEY_FILE @@ -247,7 +247,7 @@ spec: - name: empty-dir mountPath: /.mongodb subPath: app-mongosh-dir - {{- if .Values.auth.usePasswordFile }} + {{- if .Values.auth.usePasswordFiles }} - name: secrets mountPath: /bitnami/mongodb/secrets/ {{- end }} @@ -277,7 +277,7 @@ spec: {{- if $.Values.auth.enabled }} - name: MONGODB_ROOT_USER value: {{ .Values.auth.rootUser | quote }} - {{- if .Values.auth.usePasswordFile }} + {{- if .Values.auth.usePasswordFiles }} - name: MONGODB_ROOT_PASSWORD_FILE value: "/bitnami/mongodb/secrets/mongodb-root-password" {{- else }} @@ -297,7 +297,7 @@ spec: - -ec - |- #!/bin/sh - {{- if .Values.auth.usePasswordFile }} + {{- if .Values.auth.usePasswordFiles }} export MONGODB_ROOT_PASSWORD="$(cat "${MONGODB_ROOT_PASSWORD_FILE}")" {{- end }} /bin/mongodb_exporter --collect-all --compatible-mode --web.listen-address ":{{ .Values.metrics.containerPorts.metrics }}" --mongodb.uri mongodb://$(echo $MONGODB_ROOT_USER):$(echo $MONGODB_ROOT_PASSWORD | sed -r "s/@/%40/g;s/:/%3A/g")@localhost:{{ .Values.common.containerPorts.mongodb }}/admin{{ ternary "?ssl=true" "" $.Values.metrics.useTLS }} {{ .Values.metrics.extraArgs }} @@ -306,7 +306,7 @@ spec: - name: empty-dir mountPath: /tmp subPath: tmp-dir - {{- if .Values.auth.usePasswordFile }} + {{- if .Values.auth.usePasswordFiles }} - name: secrets mountPath: /bitnami/mongodb/secrets/ {{- end }} @@ -352,7 +352,7 @@ spec: volumes: - name: empty-dir emptyDir: {} - {{- if .Values.auth.usePasswordFile }} + {{- if .Values.auth.usePasswordFiles }} - name: secrets secret: secretName: {{ include "mongodb-sharded.secret" . }} diff --git a/bitnami/mongodb-sharded/templates/replicaset-entrypoint-configmap.yaml b/bitnami/mongodb-sharded/templates/replicaset-entrypoint-configmap.yaml index ac70ec743f..29a3ca2cc0 100644 --- a/bitnami/mongodb-sharded/templates/replicaset-entrypoint-configmap.yaml +++ b/bitnami/mongodb-sharded/templates/replicaset-entrypoint-configmap.yaml @@ -27,7 +27,7 @@ data: else info "Setting node as secondary" export MONGODB_REPLICA_SET_MODE=secondary - {{- if .Values.auth.usePasswordFile }} + {{- if .Values.auth.usePasswordFiles }} export MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD_FILE="$MONGODB_ROOT_PASSWORD_FILE" unset MONGODB_ROOT_PASSWORD_FILE {{- else }} diff --git a/bitnami/mongodb-sharded/templates/shard/shard-arbiter-statefulset.yaml b/bitnami/mongodb-sharded/templates/shard/shard-arbiter-statefulset.yaml index 565d69d8f4..d5df317d04 100644 --- a/bitnami/mongodb-sharded/templates/shard/shard-arbiter-statefulset.yaml +++ b/bitnami/mongodb-sharded/templates/shard/shard-arbiter-statefulset.yaml @@ -145,7 +145,7 @@ spec: {{- if $.Values.auth.enabled }} - name: MONGODB_INITIAL_PRIMARY_ROOT_USER value: {{ $.Values.auth.rootUser | quote }} - {{- if $.Values.auth.usePasswordFile }} + {{- if $.Values.auth.usePasswordFiles }} - name: MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD_FILE value: "/bitnami/mongodb/secrets/mongodb-root-password" - name: MONGODB_REPLICA_SET_KEY_FILE @@ -250,7 +250,7 @@ spec: - name: config mountPath: /bitnami/mongodb/conf/ {{- end }} - {{- if $.Values.auth.usePasswordFile }} + {{- if $.Values.auth.usePasswordFiles }} - name: secrets mountPath: /bitnami/mongodb/secrets/ {{- end }} @@ -284,7 +284,7 @@ spec: {{- if $.Values.auth.enabled }} - name: MONGODB_ROOT_USER value: {{ $.Values.auth.rootUser | quote }} - {{- if $.Values.auth.usePasswordFile }} + {{- if $.Values.auth.usePasswordFiles }} - name: MONGODB_ROOT_PASSWORD_FILE value: "/bitnami/mongodb/secrets/mongodb-root-password" {{- else }} @@ -304,7 +304,7 @@ spec: - -ec - |- #!/bin/sh - {{- if $.Values.auth.usePasswordFile }} + {{- if $.Values.auth.usePasswordFiles }} export MONGODB_ROOT_PASSWORD="$(cat "${MONGODB_ROOT_PASSWORD_FILE}")" {{- end }} /bin/mongodb_exporter --collect-all --compatible-mode --web.listen-address ":{{ $.Values.metrics.containerPorts.metrics }}" --mongodb.uri mongodb://$(echo $MONGODB_ROOT_USER):$(echo $MONGODB_ROOT_PASSWORD | sed -r "s/@/%40/g;s/:/%3A/g")@localhost:{{ $.Values.common.containerPorts.mongodb }}/admin{{ ternary "?ssl=true" "" $.Values.metrics.useTLS }} {{ $.Values.metrics.extraArgs }} @@ -313,7 +313,7 @@ spec: - name: empty-dir mountPath: /tmp subPath: tmp-dir - {{- if $.Values.auth.usePasswordFile }} + {{- if $.Values.auth.usePasswordFiles }} - name: secrets mountPath: /bitnami/mongodb/secrets/ {{- end }} @@ -364,7 +364,7 @@ spec: configMap: name: {{ include "mongodb-sharded.shardsvr.arbiter.configCM" $ }} {{- end }} - {{- if $.Values.auth.usePasswordFile }} + {{- if $.Values.auth.usePasswordFiles }} - name: secrets secret: secretName: {{ include "mongodb-sharded.secret" $ }} diff --git a/bitnami/mongodb-sharded/templates/shard/shard-data-statefulset.yaml b/bitnami/mongodb-sharded/templates/shard/shard-data-statefulset.yaml index c36a821106..ebb8e5ddf9 100644 --- a/bitnami/mongodb-sharded/templates/shard/shard-data-statefulset.yaml +++ b/bitnami/mongodb-sharded/templates/shard/shard-data-statefulset.yaml @@ -162,7 +162,7 @@ spec: {{- if $.Values.auth.enabled }} - name: MONGODB_ROOT_USER value: {{ $.Values.auth.rootUser | quote }} - {{- if $.Values.auth.usePasswordFile }} + {{- if $.Values.auth.usePasswordFiles }} - name: MONGODB_ROOT_PASSWORD_FILE value: "/bitnami/mongodb/secrets/mongodb-root-password" - name: MONGODB_REPLICA_SET_KEY_FILE @@ -246,8 +246,8 @@ spec: readinessProbe: {{- include "common.tplvalues.render" (dict "value" (omit $.Values.shardsvr.dataNode.readinessProbe "enabled") "context" $) | nindent 12 }} exec: command: - - /bin/sh - - -c + - /bin/sh + - -c - mongosh --port $MONGODB_PORT_NUMBER --eval "db.adminCommand('ping')" {{- end }} {{- if $.Values.shardsvr.dataNode.customStartupProbe }} @@ -288,7 +288,7 @@ spec: - name: config mountPath: /bitnami/mongodb/conf/ {{- end }} - {{- if $.Values.auth.usePasswordFile }} + {{- if $.Values.auth.usePasswordFiles }} - name: secrets mountPath: /bitnami/mongodb/secrets/ {{- end }} @@ -322,7 +322,7 @@ spec: {{- if $.Values.auth.enabled }} - name: MONGODB_ROOT_USER value: {{ $.Values.auth.rootUser | quote }} - {{- if $.Values.auth.usePasswordFile }} + {{- if $.Values.auth.usePasswordFiles }} - name: MONGODB_ROOT_PASSWORD_FILE value: "/bitnami/mongodb/secrets/mongodb-root-password" {{- else }} @@ -342,7 +342,7 @@ spec: - -ec - |- #!/bin/sh - {{- if $.Values.auth.usePasswordFile }} + {{- if $.Values.auth.usePasswordFiles }} export MONGODB_ROOT_PASSWORD="$(cat "${MONGODB_ROOT_PASSWORD_FILE}")" {{- end }} /bin/mongodb_exporter --collect-all --compatible-mode --web.listen-address ":{{ $.Values.metrics.containerPorts.metrics }}" --mongodb.uri mongodb://$(echo $MONGODB_ROOT_USER):$(echo $MONGODB_ROOT_PASSWORD | sed -r "s/@/%40/g;s/:/%3A/g")@localhost:{{ $.Values.common.containerPorts.mongodb }}/admin{{ ternary "?ssl=true" "" $.Values.metrics.useTLS }} {{ $.Values.metrics.extraArgs }} @@ -351,7 +351,7 @@ spec: - name: empty-dir mountPath: /tmp subPath: tmp-dir - {{- if $.Values.auth.usePasswordFile }} + {{- if $.Values.auth.usePasswordFiles }} - name: secrets mountPath: /bitnami/mongodb/secrets/ {{- end }} @@ -400,7 +400,7 @@ spec: - name: replicaset-entrypoint-configmap configMap: name: {{ printf "%s-replicaset-entrypoint" (include "common.names.fullname" $) }} - {{- if $.Values.auth.usePasswordFile }} + {{- if $.Values.auth.usePasswordFiles }} - name: secrets secret: secretName: {{ include "mongodb-sharded.secret" $ }} diff --git a/bitnami/mongodb-sharded/values.yaml b/bitnami/mongodb-sharded/values.yaml index 955bbcef09..a0251963e6 100644 --- a/bitnami/mongodb-sharded/values.yaml +++ b/bitnami/mongodb-sharded/values.yaml @@ -130,9 +130,9 @@ auth: ## NOTE: When it's set the previous parameters are ignored. ## existingSecret: "" - ## @param auth.usePasswordFile Mount credentials as files instead of using environment variables + ## @param auth.usePasswordFiles Mount credentials as files instead of using environment variables ## - usePasswordFile: false + usePasswordFiles: true ## @param shards Number of shards to be created ## ref: https://docs.mongodb.com/manual/core/sharded-cluster-shards/ ##