apiVersion: v1 data: ping-mongodb.sh: | #!/bin/bash mongosh $TLS_OPTIONS --port $MONGODB_PORT_NUMBER --eval "db.adminCommand('ping')" readiness-probe.sh: | #!/bin/bash # Run the proper check depending on the version [[ $(mongod -version | grep "db version") =~ ([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 5 ]] || [[ "$VERSION_MAJOR" -ge 4 ]] && [[ "$VERSION_MINOR" -ge 4 ]] && [[ "$VERSION_PATCH" -ge 2 ]]; then mongosh $TLS_OPTIONS --port $MONGODB_PORT_NUMBER --eval 'db.hello().isWritablePrimary || db.hello().secondary' | grep -q 'true' else mongosh $TLS_OPTIONS --port $MONGODB_PORT_NUMBER --eval 'db.isMaster().ismaster || db.isMaster().secondary' | grep -q 'true' fi startup-probe.sh: | #!/bin/bash mongosh $TLS_OPTIONS --port $MONGODB_PORT_NUMBER --eval 'db.hello().isWritablePrimary || db.hello().secondary' | grep -q 'true' kind: ConfigMap metadata: labels: app.kubernetes.io/component: mongodb app.kubernetes.io/instance: release-name app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: mongodb helm.sh/chart: mongodb-12.1.16 name: appsmith-mongodb-common-scripts namespace: appsmith