diff --git a/VERSION b/VERSION index 297eb0db93..9b4469ce68 100644 --- a/VERSION +++ b/VERSION @@ -1,4 +1,4 @@ -VERSION="2.7.2" +VERSION="2.7.3" VERSION_SUFFIX= VERSION_FULL="${VERSION}${VERSION_SUFFIX}" diff --git a/solution-base/build.sh b/solution-base/build.sh index 633c533fe0..85afcfbd04 100755 --- a/solution-base/build.sh +++ b/solution-base/build.sh @@ -37,6 +37,8 @@ MONGODB_SINGLE_NODE_PATH=${ISO_ROOT}/deploy/mongodb-1-node.yaml MONGODB_THREE_NODE_PATH=${ISO_ROOT}/deploy/mongodb-3-nodes.yaml MONGODB_SHARDED_SINGLE_NODE_PATH=${ISO_ROOT}/deploy/mongodb-sharded-1-node.yaml MONGODB_SHARDED_THREE_NODE_PATH=${ISO_ROOT}/deploy/mongodb-sharded-3-nodes.yaml +MONGODB_SHARDED_SINGLE_NODE_THREE_SHARDS_PATH=${ISO_ROOT}/deploy/mongodb-sharded-1-node-3-shards.yaml +MONGODB_SHARDED_THREE_NODE_THREE_SHARDS_PATH=${ISO_ROOT}/deploy/mongodb-sharded-3-nodes-3-shards.yaml SOLUTION_ENV='SOLUTION_ENV' @@ -199,7 +201,9 @@ function render_mongodb_sharded_yamls() function mongodb_sharded_yamls() { render_mongodb_sharded_yamls "${MONGODB_SHARDED_SINGLE_NODE_PATH}" 1 1 - render_mongodb_sharded_yamls "${MONGODB_SHARDED_THREE_NODE_PATH}" 1 3 + render_mongodb_sharded_yamls "${MONGODB_SHARDED_THREE_NODE_PATH}" 1 3 + render_mongodb_sharded_yamls "${MONGODB_SHARDED_SINGLE_NODE_THREE_SHARDS_PATH}" 3 1 + render_mongodb_sharded_yamls "${MONGODB_SHARDED_THREE_NODE_THREE_SHARDS_PATH}" 3 3 } function gen_manifest_yaml() 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 7df7c0e032..2d3907814e 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 telemtry 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,4 +37,8 @@ data: {{- end }} fi + # Disable MongoSH telemtry 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/charts/mongodb-sharded/templates/shard/shard-data-statefulset.yaml b/solution-base/mongodb/charts/mongodb-sharded/templates/shard/shard-data-statefulset.yaml index 85e76e7b82..286af48935 100644 --- a/solution-base/mongodb/charts/mongodb-sharded/templates/shard/shard-data-statefulset.yaml +++ b/solution-base/mongodb/charts/mongodb-sharded/templates/shard/shard-data-statefulset.yaml @@ -374,7 +374,9 @@ spec: {{- end }} {{- if $.Values.shardsvr.persistence.selector }} selector: -{{ toYaml $.Values.shardsvr.persistence.selector | indent 10 }} + matchLabels: + shard: '{{ $i }}' +{{ toYaml $.Values.shardsvr.persistence.selector.matchLabels | indent 12 }} {{- end }} resources: requests: 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..31ec6cbd90 --- /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 telemtry 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 telemtry to support offline deployments + mongosh --nodb --eval "disableTelemetry()" ++ info "MongoDB Telemetry is now disabled." + + exec /entrypoint.sh /run.sh +-- +2.25.1 +