I am learning Kubernetes and finding some suggestions about deploying my application.
My application background:
Backend: NodeJS
Frontend: ReactJS
Database: MongoDB (Just run mongod to start instead of using MongoDB cloud services)
I already know how to use Docker compose to deploy the application in single node.
And now I want to deploy the application with Kubernetes (3 nodes).
So how to deploy MongoDB and make sure the MongoDB data is synchronize in 3 nodes?
I have researched some information about this and I am confused on some keywords.
E.g. Deploy a Standalone MongoDB Instance, StatefulSet, ...
Are this information / articles suitable for my situation? or do you know any information about this? Thanks!
You can create helm charts for your apps for deployment -
npm build
For MongoDb deployment, use this chart https://github.com/bitnami/charts/tree/master/bitnami/mongodb
You can install mongodb using this helm chart.
You can start the MongoDB chart in replica set mode with the following parameter: replicaSet.enabled=true
Some characteristics of this chart are:
Each of the participants in the replication has a fixed stateful set so you always know where to find the primary, secondary or arbiter nodes. The number of secondary and arbiter nodes can be scaled out independently. Easy to move an application from using a standalone MongoDB server to use a replica set.
See here to learn configuration and installation details