Skip to content

Commit 7f323a5

Browse files
ZENKO-4527: patch mongodb charts to disable telemetry
1 parent d073520 commit 7f323a5

File tree

5 files changed

+88
-2
lines changed

5 files changed

+88
-2
lines changed

solution-base/deps.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# yq eval 'sortKeys(.)' -i deps.yaml
44
mongodb:
55
image: bitnami/mongodb
6-
tag: 4.2.21-debian-10-r8
6+
tag: 4.0.27-debian-9-r118
77
mongodb-exporter:
88
image: bitnami/mongodb-exporter
99
tag: 0.34.0-debian-11-r24

solution-base/mongodb/charts/mongodb-sharded/templates/mongos/mongos-dep-sts.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ spec:
8484
runAsNonRoot: {{ .Values.securityContext.runAsNonRoot }}
8585
runAsUser: {{ .Values.securityContext.runAsUser }}
8686
{{- end }}
87+
command:
88+
- /bin/bash
89+
- /entrypoint/mongos-entrypoint.sh
8790
env:
8891
- name: MONGODB_ENABLE_NUMACTL
8992
value: {{ ternary "yes" "no" $.Values.common.mongodbEnableNumactl | quote }}
@@ -209,6 +212,8 @@ spec:
209212
{{- end }}
210213
{{- end }}
211214
volumeMounts:
215+
- name: replicaset-entrypoint-configmap
216+
mountPath: /entrypoint
212217
{{- if .Values.usePasswordFile }}
213218
- name: secrets
214219
mountPath: /bitnami/mongodb/secrets/
@@ -299,6 +304,9 @@ spec:
299304
{{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | nindent 8 }}
300305
{{- end }}
301306
volumes:
307+
- name: replicaset-entrypoint-configmap
308+
configMap:
309+
name: {{ include "common.names.fullname" . }}-replicaset-entrypoint
302310
{{- if .Values.usePasswordFile }}
303311
- name: secrets
304312
secret:

solution-base/mongodb/charts/mongodb-sharded/templates/replicaset-entrypoint-configmap.yaml

+12-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@ metadata:
44
name: {{ include "common.names.fullname" . }}-replicaset-entrypoint
55
labels: {{- include "common.labels.standard" . | nindent 4 }}
66
data:
7+
mongos-entrypoint.sh: |-
8+
#!/bin/bash
9+
10+
. /liblog.sh
11+
12+
# Disable MongoSH telemetry to support offline deployments
13+
mongosh --nodb --eval "disableTelemetry()"
14+
info "MongoDB Telemetry is now disabled."
15+
16+
exec /entrypoint.sh /run.sh
717
replicaset-entrypoint.sh: |-
818
#!/bin/bash
919
@@ -27,7 +37,8 @@ data:
2737
{{- end }}
2838
fi
2939
30-
# Disable MongoSH telemtry to support offline deployments
40+
# Disable MongoSH telemetry to support offline deployments
3141
mongosh --nodb --eval "disableTelemetry()"
42+
info "MongoDB Telemetry is now disabled."
3243
3344
exec /entrypoint.sh /run.sh
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
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
2+
index 6be3476e..0bc6f8a9 100644
3+
--- a/solution-base/mongodb/charts/mongodb-sharded/templates/mongos/mongos-dep-sts.yaml
4+
+++ b/solution-base/mongodb/charts/mongodb-sharded/templates/mongos/mongos-dep-sts.yaml
5+
@@ -84,6 +84,9 @@ spec:
6+
runAsNonRoot: {{ .Values.securityContext.runAsNonRoot }}
7+
runAsUser: {{ .Values.securityContext.runAsUser }}
8+
{{- end }}
9+
+ command:
10+
+ - /bin/bash
11+
+ - /entrypoint/mongos-entrypoint.sh
12+
env:
13+
- name: MONGODB_ENABLE_NUMACTL
14+
value: {{ ternary "yes" "no" $.Values.common.mongodbEnableNumactl | quote }}
15+
@@ -209,6 +212,8 @@ spec:
16+
{{- end }}
17+
{{- end }}
18+
volumeMounts:
19+
+ - name: replicaset-entrypoint-configmap
20+
+ mountPath: /entrypoint
21+
{{- if .Values.usePasswordFile }}
22+
- name: secrets
23+
mountPath: /bitnami/mongodb/secrets/
24+
@@ -299,6 +304,9 @@ spec:
25+
{{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | nindent 8 }}
26+
{{- end }}
27+
volumes:
28+
+ - name: replicaset-entrypoint-configmap
29+
+ configMap:
30+
+ name: {{ include "common.names.fullname" . }}-replicaset-entrypoint
31+
{{- if .Values.usePasswordFile }}
32+
- name: secrets
33+
secret:
34+
--
35+
2.25.1
36+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
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
2+
index 22bdc5d7..36526df2 100644
3+
--- a/solution-base/mongodb/charts/mongodb-sharded/templates/replicaset-entrypoint-configmap.yaml
4+
+++ b/solution-base/mongodb/charts/mongodb-sharded/templates/replicaset-entrypoint-configmap.yaml
5+
@@ -4,6 +4,16 @@ metadata:
6+
name: {{ include "common.names.fullname" . }}-replicaset-entrypoint
7+
labels: {{- include "common.labels.standard" . | nindent 4 }}
8+
data:
9+
+ mongos-entrypoint.sh: |-
10+
+ #!/bin/bash
11+
+
12+
+ . /liblog.sh
13+
+
14+
+ # Disable MongoSH telemetry to support offline deployments
15+
+ mongosh --nodb --eval "disableTelemetry()"
16+
+ info "MongoDB Telemetry is now disabled."
17+
+
18+
+ exec /entrypoint.sh /run.sh
19+
replicaset-entrypoint.sh: |-
20+
#!/bin/bash
21+
22+
@@ -29,5 +39,6 @@ data:
23+
24+
+ # Disable MongoSH telemetry to support offline deployments
25+
+ mongosh --nodb --eval "disableTelemetry()"
26+
+ info "MongoDB Telemetry is now disabled."
27+
28+
exec /entrypoint.sh /run.sh
29+
--
30+
2.25.1
31+

0 commit comments

Comments
 (0)