apiVersion: v1
kind: ConfigMap
metadata:
  name: myrocket-mongodb-scripts
  labels:
    app.kubernetes.io/name: mongodb
    app.kubernetes.io/instance: myrocket
    app.kubernetes.io/component: mongodb
data:
  setup.sh: |-
    #!/bin/bash

    . /opt/bitnami/scripts/mongodb-env.sh
    echo "Pod name matches initial primary pod name, configuring node as a primary"
    export MONGODB_REPLICA_SET_MODE="primary"
    exec /opt/bitnami/scripts/mongodb/entrypoint.sh /opt/bitnami/scripts/mongodb/run.sh