Image is build with each merge to main
branch. For specific version, set a tag. That will trigger new build.
Login to destintation and source database. Start mongosh
and execute following commands:
db.adminCommand( {
createRole: "reverseSync",
privileges: [ {
resource: { db: "", collection: "" },
actions: [ "setUserWriteBlockMode", "bypassWriteBlockingMode" ]
} ],
roles: []
} )
use admin
db.createUser(
{
user: "mongosync-user",
pwd: "<strong-password>",
roles: [ "readWrite", "dbAdmin", "reverseSync"]
}
)
If you have doubts regarding roles required by mongosync
, please refer to official documentation.
Create new namespace
kubectl create namespace infra-mongosync
Update cluster0
and cluster1
fields in ./manifests/mongosync-cm.yml
file and apply it.
kubectl apply -f ./manifests/mongosync-cm.yml
Next, deploy mongosync
pod.
kubectl apply -f ./manifests/mongosync-deployment.yml
Expose port to mongosync
kubectl -n infra-mongosync port-forwards svc/mongosync 27182:27182
Verify connection to mongosync
pod.
curl http://localhost:27182/api/v1/progress
curl localhost:27182/api/v1/start -XPOST --data @payload.json