mongosync

by serge.logvinov

Helm chartv0.4.0App 1.15.0Verified publisher

Mongo Cluster-to-Cluster Sync

About this chart

mongosync

Mongo Cluster-to-Cluster Sync

This tool is used to sync data from one MongoDB cluster to another. It is designed to be used in a Kubernetes environment.

Homepage: https://github.com/sergelogvinov/helm-charts

Maintainers

NameEmailUrl
sergelogvinovhttps://github.com/sergelogvinov

Source Code

Run mongo sync

curl localhost:27182/api/v1/start -XPOST \
--data '{
      "source": "cluster0",
      "destination": "cluster1",
      "enableUserWriteBlocking": true,
      "verification": {
        "enabled": false
      }
   }'

Check progress

curl localhost:27182/api/v1/progress -XGET

Finish sync

curl localhost:27182/api/v1/commit -XPOST --data '{ }'

Values

KeyTypeDefaultDescription
replicaCountint1
image.repositorystring"ghcr.io/sergelogvinov/mongosync"
image.pullPolicystring"IfNotPresent"
image.tagstring""
imagePullSecretslist[]
nameOverridestring""
fullnameOverridestring""
hostAliaseslist[]
config.cluster0string"mongodb://192.0.2.10:27017/admin"
config.cluster1string"mongodb://192.0.2.20:27017/admin"
config.verbositystring"INFO"
config.disableTelemetrybooltrue
filterslist[]
argslist[]Mongosqld arguments example: - --verbosity=DEBUG
serviceAccountobject{"annotations":{},"create":true,"name":""}Pods Service Account. ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
podAnnotationsobject{}Annotations for pod. ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
podSecurityContextobject{"fsGroup":34,"fsGroupChangePolicy":"OnRootMismatch","runAsGroup":34,"runAsNonRoot":true,"runAsUser":34}Pod Security Context. ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod
securityContextobject{"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]},"readOnlyRootFilesystem":true,"seccompProfile":{"type":"RuntimeDefault"}}Container Security Context. ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod
serviceobject{"port":27182,"type":"ClusterIP"}Service parameters ref: https://kubernetes.io/docs/user-guide/services/
resourcesobject{"limits":{"cpu":"500m"},"requests":{"cpu":"100m","memory":"1Gi"}}Resource requests and limits. ref: https://kubernetes.io/docs/user-guide/compute-resources/
nodeSelectorobject{"kubernetes.io/arch":"amd64"}Node labels for pod assignment. ref: https://kubernetes.io/docs/user-guide/node-selection/
tolerationslist[]Tolerations for pod assignment. ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
affinityobject{}Affinity for pod assignment. ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity

Deploy mongosync with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has mongosync on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartmongosync is pinned at v0.4.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply