apiVersion: v1
data:
  script.sh: |-
    #!/bin/bash
    if [[ "$POD_NAME" = "mongodb-0" ]];
    then
    export MONGODB_REPLICA_SET_MODE="primary"
    else
    export MONGODB_INITIAL_PRIMARY_PORT_NUMBER="27017"
    export MONGODB_REPLICA_SET_MODE="secondary"
    
    fi
    exec /opt/bitnami/scripts/mongodb/entrypoint.sh /opt/bitnami/scripts/mongodb/run.sh
kind: ConfigMap
metadata:
  name: mongo-config
  namespace: cap