I deployed a MongoDB in Kubernetes cluster with one user all the pods and containers are working fine without any issues. But if I try to add more than one user in the MongoDB I’m facing the issue Readiness probe failed. Mongodb-agent container is not in ready state.
I add the users in mongodb.com_v1mongodbcommunity_cr.yaml file
---
apiVersion: mongodbcommunity.mongodb.com/v1
kind: MongoDBCommunity
metadata:
name: example-mongodb
spec:
members: 3
type: ReplicaSet
version: "4.2.6"
security:
authentication:
modes: ["SCRAM"]
users:
- name: user
db: admin
passwordSecretRef: # a reference to the secret that will be used to generate the user's password
name: user
roles:
- name: clusterAdmin
db: admin
- name: userAdminAnyDatabase
db: admin
- name: dbOwner
db: admin
scramCredentialsSecretName: my-scram
- name: user1
db: admin
passwordSecretRef: # a reference to the secret that will be used to generate the user's password
name: user1
roles:
- name: clusterAdmin
db: admin
- name: userAdminAnyDatabase
db: admin
scramCredentialsSecretName: my-scram
additionalMongodConfig:
storage.wiredTiger.engineConfig.journalCompressor: zlib
# the user credentials will be generated from this secret
# once the credentials are generated, this secret is no longer required
---
apiVersion: v1
kind: Secret
metadata:
name: user
type: Opaque
stringData:
password: xxxxx
---
apiVersion: v1
kind: Secret
metadata:
name: user1
type: Opaque
stringData:
password: xxx
This is file I’m currently using. If I deploy this file I’m facing the Readiness probe failed issue.
All the MongoDB container goes to 1/2 state.