At the moment I have a mongo database with three instances one master and two slaves.
At the moment the database is on kubernetes hosted by aws. The maximum cpu cores is 4 and from time to time when I am running heavy processing the cpu used for mongo is 100% (4 cores).
First I have an issue with kubernetes to manage external connection using replica set because when you are doing a connection to a replica set the server response is the internal kubernetes endpoints so the external client can not connect, I have to always connect to the master from outside if I am working outside the cluster. At the moment this is not really an issue as I do not have external app connected, only debug tools, but could be for later.
Then I do not know if hosting mongodb on kubernetes is a good solution or is it better to do it external, I can not found any best practice on it.
I do not really understand why when I am doing heavy process on mongo only the cpu of the master is becoming crazy and the other do not move, my connection url is
But I have the impression that only the master is working, when I am running
rs.status() everything seems fine.