mongodb-backup

by serge.logvinov

Helm chartv1.1.0App 8.0.10Verified publisher

Mongo backup with restore checks

About this chart

mongodb-backup

Mongo backup with restore checks

The mongodb-backup chart provides a way to backup and restore a MongoDB database to an external storage using wal-g

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

Maintainers

NameEmailUrl
sergelogvinovhttps://github.com/sergelogvinov

Source Code

# helm values

auth:
  host: mongo-0.mongo-headless:27017/?authSource=admin

walg: |
  WALG_S3_PREFIX: s3://backup/mongo-backup

extraVolumes:
  - name: s3-secrets
    secret:
      defaultMode: 256
      secretName: backup-s3
extraVolumeMounts:
  - name: s3-secrets
    mountPath: /var/backups/.aws
    readOnly: true

backupCheck:
  enabled: true

Values

KeyTypeDefaultDescription
replicaCountint1
image.repositorystring"ghcr.io/sergelogvinov/mongodb"
image.pullPolicystring"IfNotPresent"
image.tagstring""
imagePullSecretslist[]
nameOverridestring""
fullnameOverridestring""
schedulestring"0 1 * * *"
cleanPolicystring"retain 3 --retain-count 3"
activeDeadlineSecondsint3600
backupCheck.enabledboolfalse
backupCheck.schedulestring"15 8 * * *"
backupCheck.resources.limits.cpuint2
backupCheck.resources.limits.memorystring"1Gi"
backupCheck.resources.requests.cpuint2
backupCheck.resources.requests.memorystring"512Mi"
backupCheck.persistenceobject{"accessModes":["ReadWriteOnce"],"annotations":{},"size":"8Gi"}Persistence parameters ref: https://kubernetes.io/docs/user-guide/persistent-volumes/
backupCheck.nodeSelectorobject{}Node labels for backup check pod assignment. ref: https://kubernetes.io/docs/user-guide/node-selection/
backupCheck.tolerationslist[]Tolerations for backup check pod assignment. ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
backupCheck.affinityobject{}Affinity for backup check pod assignment. ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
auth.hoststring"mongo-headless:27017/?authSource=admin"
auth.usernamestring"root"
auth.passwordstring"root"
backupOplogbooltrue
envlist[]
walgobject{}
serviceAccountobject{"annotations":{},"create":true,"name":""}Pods Service Account. ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
podLabelsobject{}Extra labels for pod. ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
podAnnotationsobject{}Annotations for pod. ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
podSecurityContextobject{"fsGroup":34,"fsGroupChangePolicy":"OnRootMismatch","runAsGroup":0,"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"]},"seccompProfile":{"type":"RuntimeDefault"}}Container Security Context. ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod
resourcesobject{"requests":{"cpu":"500m","memory":"256Mi"}}Resource requests and limits. ref: https://kubernetes.io/docs/user-guide/compute-resources/
persistenceobject{"accessModes":["ReadWriteOnce"],"annotations":{},"enabled":false,"existingClaim":"","size":"10Gi"}Persistence parameters ref: https://kubernetes.io/docs/user-guide/persistent-volumes/
nodeSelectorobject{}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 mongodb-backup with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has mongodb-backup 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 chartmongodb-backup is pinned at v1.1.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