简体   繁体   中英

Deploy Mongodb and NodeJS with Kubernetes

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.

Eg 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 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM