1. Install kubernete
2. Install Metallb system
3 Run file .yaml
$ kubectl create -f .
4.connect mongo pod together
Set primary node
$ kubectl exec -it mongo-0.mongo:27017
> rs.initiate()
> var ctx = rs.conf()
> ctx.members[0].host="mongo-0.mongo:27017"
re-save config
> rs.reconfig(ctx)
connect rest node to primary node :3
> rs.add("mongo-1.mongo:27017")
> rs.add("mongi-2.mongo:27017")
check it with creeate new mongo shell pod
$ mongo mongodb://mongo-0.mongo,mongo-1.mongo,mongo-2.mongo
and check with
> rs.status()
Sirawich Voungchuy :3