Closed percenuage closed 1 year ago
Hi,
Could you try changing the probe by using customLivenessProbe
and customReadinessProbe
? There you could workaround the mongosh
issue.
Hi, With these ones, it works:
livenessProbe:
exec:
command:
- mongo
- --disableImplicitSessions
- --eval
- db.adminCommand('ping')
failureThreshold: 6
initialDelaySeconds: 30
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 5
readinessProbe:
exec:
command:
- bash
- -ec
- |
# Run the proper check depending on the version
[[ $(mongo --version | grep "MongoDB shell") =~ ([0-9]+\.[0-9]+\.[0-9]+) ]] && VERSION=${BASH_REMATCH[1]}
. /opt/bitnami/scripts/libversion.sh
VERSION_MAJOR="$(get_sematic_version "$VERSION" 1)"
VERSION_MINOR="$(get_sematic_version "$VERSION" 2)"
VERSION_PATCH="$(get_sematic_version "$VERSION" 3)"
if [[ "$VERSION_MAJOR" -ge 4 ]] && [[ "$VERSION_MINOR" -ge 4 ]] && [[ "$VERSION_PATCH" -ge 2 ]]; then
mongo --disableImplicitSessions $TLS_OPTIONS --eval 'db.hello().isWritablePrimary || db.hello().secondary' | grep -q 'true'
else
mongo --disableImplicitSessions $TLS_OPTIONS --eval 'db.isMaster().ismaster || db.isMaster().secondary' | grep -q 'true'
fi
failureThreshold: 6
initialDelaySeconds: 5
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 5
It should have notes about the incompatibility with older mongo version (without updating readiness & liveness). The v4.4 is still maintained by MongoDB until February 2024 😄.
Thanks for the feedback and for sharing your solution! Would you like to submit a PR updating the README with that warning?
This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.
Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Issue. Do not hesitate to reopen it later if necessary.
Note to future readers, I copied the values given by @percenuage and it worked great, but I did need to replace livenessProbe
and readinessProbe
with customLivenessProbe
and customReadinessProbe
Name and Version
bitnami/mongodb >=12.0.0
What architecture are you using?
None
What steps will reproduce the bug?
Deploy mongodb in replicaset (chart version 13.9.4) with these values:
Are you using any custom parameters or values?
No response
What is the expected behavior?
Mongodb replicaset should start normally.
What do you see instead?
Additional information
I used mongodb helm chart version 10.26.4. Since this version does not exist anymore, I try to upgrade to the latest version 13.9.4 but I don't want to update my mongodb version to v6 (which I suppose works with chart v 13.9.4)