MongodbOperator for MongoDb 7 is not working

Description:

The mongodb operator does not work with MongoDb 7. I’m trying to update the image from version 6.0.9-7 to version 7.0.4-2 and this error pops up:

parsing config with mongo
/opt/percona/ps-entry.sh: line 221: mongo: command not found
+ exec mongod --bind_ip_all --auth --dbpath=/data/db --port=27017 --replSet=cfg --storageEngine=wiredTiger --relaxPermChecks --clusterAuthMode=x509 --configsvr --enableEncryption --encryptionKeyFile=/etc/mongodb-encryption/encryption-key --wiredTigerCacheSizeGB=0.25 --wiredTigerIndexPrefixCompression=true --config=/etc/mongodb-config/mongod.conf --tlsMode '' --tlsCertificateKeyFile /tmp/tls.pem --tlsAllowInvalidCertificates --tlsClusterFile /tmp/tls-internal.pem --tlsCAFile /etc/mongodb-ssl/ca.crt --tlsClusterCAFile /etc/mongodb-ssl-internal/ca.crt
{"t":{"$date":"2023-12-12T20:06:41.031Z"},"s":"F",  "c":"CONTROL",  "id":20574,   "ctx":"main","msg":"Error during global initialization","attr":{"error":{"code":2,"codeName":"BadValue","errmsg":"unsupported value for tlsMode "}}}

To me it looks like there is a problem somewhere is this file: /opt/percona/ps-entry.sh. With the previous version the mongod command looked like this:

+ exec mongod --bind_ip_all --auth --dbpath=/data/db --port=27017 --replSet=cfg --storageEngine=wiredTiger --relaxPermChecks --clusterAuthMode=x509 --configsvr --enableEncryption --encryptionKeyFile=/etc/mongodb-encryption/encryption-key --wiredTigerCacheSizeGB=0.25 --wiredTigerIndexPrefixCompression=true --config=/etc/mongodb-config/mongod.conf --tlsMode requireTLS --tlsCertificateKeyFile /tmp/tls.pem --tlsAllowInvalidCertificates --tlsClusterFile /tmp/tls-internal.pem --tlsCAFile /etc/mongodb-ssl/ca.crt --tlsClusterCAFile /etc/mongodb-ssl-internal/ca.crt

Steps to Reproduce:

  • MongoDb image: percona-server-mongodb image to 7.0.4-2

  • Operator version: percona-server-mongodb-operator:1.15.0

  • Configuration file:

    net:
      tls:
        mode: requireTLS
        allowConnectionsWithoutCertificates: true
    
  • Not sure if it matters, but Im using CertManager to generate my own certificate, so I did set the secrets.ssl and secrets.sslInternal to the secret with the generated certificate.

Version:

MongoDbOperator: 1.15.0
MongoDb: 7.0.4-2

Hi @Knaruf, PSMDB operator does not support MongoDB v7.0. We have a task regarding it. It will be added in the next release. We have a plan to release v1.16.0 in Q1.

1 Like