diff --git a/solution-base/deps.yaml b/solution-base/deps.yaml index 2b9908965b..834b41d4bb 100644 --- a/solution-base/deps.yaml +++ b/solution-base/deps.yaml @@ -3,7 +3,7 @@ # yq eval 'sortKeys(.)' -i deps.yaml mongodb: image: bitnami/mongodb - tag: 4.2.21-debian-10-r8 + tag: 4.0.27-debian-9-r118 mongodb-exporter: image: bitnami/mongodb-exporter tag: 0.34.0-debian-11-r24 diff --git a/solution-base/mongodb/charts/mongodb-sharded/templates/mongos/mongos-dep-sts.yaml b/solution-base/mongodb/charts/mongodb-sharded/templates/mongos/mongos-dep-sts.yaml index 6be3476e25..fdee2a9a79 100644 --- a/solution-base/mongodb/charts/mongodb-sharded/templates/mongos/mongos-dep-sts.yaml +++ b/solution-base/mongodb/charts/mongodb-sharded/templates/mongos/mongos-dep-sts.yaml @@ -84,6 +84,9 @@ spec: runAsNonRoot: {{ .Values.securityContext.runAsNonRoot }} runAsUser: {{ .Values.securityContext.runAsUser }} {{- end }} + command: + - /bin/bash + - /entrypoint/mongos-entrypoint.sh env: - name: MONGODB_ENABLE_NUMACTL value: {{ ternary "yes" "no" $.Values.common.mongodbEnableNumactl | quote }} @@ -209,6 +212,8 @@ spec: {{- end }} {{- end }} volumeMounts: + - name: replicaset-entrypoint-configmap + mountPath: /entrypoint {{- if .Values.usePasswordFile }} - name: secrets mountPath: /bitnami/mongodb/secrets/ @@ -299,6 +304,9 @@ spec: {{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | nindent 8 }} {{- end }} volumes: + - name: replicaset-entrypoint-configmap + configMap: + name: {{ include "common.names.fullname" . }}-replicaset-entrypoint {{- if .Values.usePasswordFile }} - name: secrets secret: diff --git a/solution-base/mongodb/charts/mongodb-sharded/templates/replicaset-entrypoint-configmap.yaml b/solution-base/mongodb/charts/mongodb-sharded/templates/replicaset-entrypoint-configmap.yaml index 22bdc5d764..376aebfbc6 100644 --- a/solution-base/mongodb/charts/mongodb-sharded/templates/replicaset-entrypoint-configmap.yaml +++ b/solution-base/mongodb/charts/mongodb-sharded/templates/replicaset-entrypoint-configmap.yaml @@ -4,6 +4,16 @@ metadata: name: {{ include "common.names.fullname" . }}-replicaset-entrypoint labels: {{- include "common.labels.standard" . | nindent 4 }} data: + mongos-entrypoint.sh: |- + #!/bin/bash + + . /liblog.sh + + # Disable MongoSH telemetry to support offline deployments + mongosh --nodb --eval "disableTelemetry()" + info "MongoDB Telemetry is now disabled." + + exec /entrypoint.sh /run.sh replicaset-entrypoint.sh: |- #!/bin/bash @@ -27,7 +37,8 @@ data: {{- end }} fi - # Disable MongoSH telemtry to support offline deployments + # Disable MongoSH telemetry to support offline deployments mongosh --nodb --eval "disableTelemetry()" + info "MongoDB Telemetry is now disabled." exec /entrypoint.sh /run.sh diff --git a/solution-base/mongodb/patches/mongos-dep-sts.patch b/solution-base/mongodb/patches/mongos-dep-sts.patch new file mode 100644 index 0000000000..434bc48cf5 --- /dev/null +++ b/solution-base/mongodb/patches/mongos-dep-sts.patch @@ -0,0 +1,36 @@ +diff --git a/solution-base/mongodb/charts/mongodb-sharded/templates/mongos/mongos-dep-sts.yaml b/solution-base/mongodb/charts/mongodb-sharded/templates/mongos/mongos-dep-sts.yaml +index 6be3476e..0bc6f8a9 100644 +--- a/solution-base/mongodb/charts/mongodb-sharded/templates/mongos/mongos-dep-sts.yaml ++++ b/solution-base/mongodb/charts/mongodb-sharded/templates/mongos/mongos-dep-sts.yaml +@@ -84,6 +84,9 @@ spec: + runAsNonRoot: {{ .Values.securityContext.runAsNonRoot }} + runAsUser: {{ .Values.securityContext.runAsUser }} + {{- end }} ++ command: ++ - /bin/bash ++ - /entrypoint/mongos-entrypoint.sh + env: + - name: MONGODB_ENABLE_NUMACTL + value: {{ ternary "yes" "no" $.Values.common.mongodbEnableNumactl | quote }} +@@ -209,6 +212,8 @@ spec: + {{- end }} + {{- end }} + volumeMounts: ++ - name: replicaset-entrypoint-configmap ++ mountPath: /entrypoint + {{- if .Values.usePasswordFile }} + - name: secrets + mountPath: /bitnami/mongodb/secrets/ +@@ -299,6 +304,9 @@ spec: + {{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | nindent 8 }} + {{- end }} + volumes: ++ - name: replicaset-entrypoint-configmap ++ configMap: ++ name: {{ include "common.names.fullname" . }}-replicaset-entrypoint + {{- if .Values.usePasswordFile }} + - name: secrets + secret: +-- +2.25.1 + diff --git a/solution-base/mongodb/patches/replicaset-entrypoint-configmap.patch b/solution-base/mongodb/patches/replicaset-entrypoint-configmap.patch new file mode 100644 index 0000000000..80772a5016 --- /dev/null +++ b/solution-base/mongodb/patches/replicaset-entrypoint-configmap.patch @@ -0,0 +1,31 @@ +diff --git a/solution-base/mongodb/charts/mongodb-sharded/templates/replicaset-entrypoint-configmap.yaml b/solution-base/mongodb/charts/mongodb-sharded/templates/replicaset-entrypoint-configmap.yaml +index 22bdc5d7..36526df2 100644 +--- a/solution-base/mongodb/charts/mongodb-sharded/templates/replicaset-entrypoint-configmap.yaml ++++ b/solution-base/mongodb/charts/mongodb-sharded/templates/replicaset-entrypoint-configmap.yaml +@@ -4,6 +4,16 @@ metadata: + name: {{ include "common.names.fullname" . }}-replicaset-entrypoint + labels: {{- include "common.labels.standard" . | nindent 4 }} + data: ++ mongos-entrypoint.sh: |- ++ #!/bin/bash ++ ++ . /liblog.sh ++ ++ # Disable MongoSH telemetry to support offline deployments ++ mongosh --nodb --eval "disableTelemetry()" ++ info "MongoDB Telemetry is now disabled." ++ ++ exec /entrypoint.sh /run.sh + replicaset-entrypoint.sh: |- + #!/bin/bash + +@@ -29,5 +39,6 @@ data: + ++ # Disable MongoSH telemetry to support offline deployments ++ mongosh --nodb --eval "disableTelemetry()" ++ info "MongoDB Telemetry is now disabled." + + exec /entrypoint.sh /run.sh +-- +2.25.1 +