|
| 1 | +.. _ak8so-backup: |
| 2 | + |
| 3 | +================================== |
| 4 | +Back Up Your |service| {+Cluster+} |
| 5 | +================================== |
| 6 | + |
| 7 | +.. default-domain:: mongodb |
| 8 | + |
| 9 | +.. contents:: On this page |
| 10 | + :local: |
| 11 | + :backlinks: none |
| 12 | + :depth: 2 |
| 13 | + :class: singlecol |
| 14 | + |
| 15 | +.. include:: /includes/fact-atlas-free-tier-limits.rst |
| 16 | + |
| 17 | +.. note:: {+Serverless-instances+} back up automatically |
| 18 | + |
| 19 | + |service| automatically enables backups for {+serverless-instances+} |
| 20 | + and takes snapshots every six hours. Any |ak8so| backup custom |
| 21 | + resources you apply to a {+serverless-instance+} will not override |
| 22 | + the automatic settings. |
| 23 | + |
| 24 | + To learn more about backups for {+serverless-instances+}, see |
| 25 | + :ref:`serverless-snapshots`. |
| 26 | + |
| 27 | +|ak8so| supports :ref:`{+cloud-backup+} <backup-cloud-provider>` for |
| 28 | +your |service| {+clusters+}. {+Cloud-backup+} uses the native |
| 29 | +snapshot capabilities of your cloud provider to support full-copy |
| 30 | +snapshots and localized snapshot storage. |
| 31 | + |
| 32 | +To manage {+cloud-backup+} with |ak8so|, you can specify and |
| 33 | +update the following custom resources: |
| 34 | + |
| 35 | +.. list-table:: |
| 36 | + :widths: 50 80 |
| 37 | + :header-rows: 1 |
| 38 | + |
| 39 | + * - Custom Resource |
| 40 | + - Purpose |
| 41 | + |
| 42 | + * - :ref:`atlasbackuppolicy-custom-resource` |
| 43 | + - Defines the backup policy, including the frequency of backups |
| 44 | + and the length of snapshot retention. |
| 45 | + |
| 46 | + * - :ref:`atlasbackupschedule-custom-resource` |
| 47 | + - Defines the backup schedule, including the time of day that |
| 48 | + |service| backs up your {+database-deployment+}, the number |
| 49 | + of days back in time to which you can restore, and the backup policy. |
| 50 | + |
| 51 | + * - :ref:`atlasdeployment-custom-resource` |
| 52 | + - Defines the characteristics of a {+cluster+}. You |
| 53 | + must set the :setting:`spec.backupRef.name` field to the name of |
| 54 | + the configured backup schedule to enable {+cloud-backup+} for |
| 55 | + the {+cluster+}. |
| 56 | + |
| 57 | + Additionally, to configure continuous backup, you must set :setting:`spec.deploymentSpec.pitEnabled` to ``true``. |
| 58 | + |
| 59 | +Each time you change any of the supported custom resources, |ak8so| |
| 60 | +:ref:`creates or updates <ak8so-create-update-process>` the |
| 61 | +corresponding |service| configuration. |
| 62 | + |
| 63 | +Considerations |
| 64 | +-------------- |
| 65 | + |
| 66 | +Review the following considerations: |
| 67 | + |
| 68 | +- You can specify one backup policy per backup schedule. |
| 69 | +- You can specify one backup schedule per {+cluster+}, but |
| 70 | + you can use the same backup schedule for multiple |
| 71 | + {+clusters+}. |
| 72 | +- |service| determines the order of nodes to snapshot based on your |
| 73 | + {+cluster+} configuration. To learn more, see |
| 74 | + :ref:`Cloud Backups <single-region-cloud-backup>`. |
| 75 | +- |ak8so| supports automatic :ref:`snapshot distribution <snapshot-distribution>`. |
| 76 | + You can configure this with the ``spec.copySetting`` field in the |
| 77 | + :ref:`atlasbackupschedule-custom-resource`. |
| 78 | + |
| 79 | +Limitations |
| 80 | +----------- |
| 81 | + |
| 82 | +Certain limitations apply to {+cloud-backup+}. To learn more, see |
| 83 | +:ref:`<backup-cloud-provider>`. |
| 84 | + |
| 85 | +Prerequisites |
| 86 | +------------- |
| 87 | + |
| 88 | +To enable {+cloud-backup+} for your |ak8so|-managed |
| 89 | +{+cluster+}, you must: |
| 90 | + |
| 91 | +- Have a running |k8s| cluster with |
| 92 | + |ak8so| :ref:`deployed <ak8so-quick-start-ref>`. |
| 93 | +- Ensure your |ipaddr| address is in the organization's |api| |
| 94 | + :ref:`access list <access-list>`. |
| 95 | + |
| 96 | +.. _ak8so-configure-backup: |
| 97 | + |
| 98 | +Procedure |
| 99 | +--------- |
| 100 | + |
| 101 | +Follow these steps to enable {+cloud-backup+} for your |ak8so|-managed |
| 102 | +{+clusters+}: |
| 103 | + |
| 104 | +.. procedure:: |
| 105 | + :style: normal |
| 106 | + |
| 107 | + .. step:: Create the backup policy. |
| 108 | + |
| 109 | + To learn more about the parameters for a backup policy, see |
| 110 | + :ref:`atlasbackuppolicy-custom-resource`. |
| 111 | + |
| 112 | + **Example:** |
| 113 | + |
| 114 | + .. code-block:: sh |
| 115 | + |
| 116 | + cat <<EOF | kubectl apply -f - |
| 117 | + apiVersion: atlas.mongodb.com/v1 |
| 118 | + kind: AtlasBackupPolicy |
| 119 | + metadata: |
| 120 | + name: "atlas-default-backuppolicy" |
| 121 | + labels: |
| 122 | + app.kubernetes.io/version: 1.6.0 |
| 123 | + spec: |
| 124 | + items: |
| 125 | + frequencyType: "weekly" |
| 126 | + frequencyInterval: 1 |
| 127 | + retentionUnit: "days" |
| 128 | + retentionValue: 7 |
| 129 | + EOF |
| 130 | + |
| 131 | + .. step:: Create the backup schedule. |
| 132 | + |
| 133 | + In the :setting:`spec.policy.name` field, specify the |
| 134 | + ``metadata.name`` from the |
| 135 | + :ref:`atlasbackuppolicy-custom-resource` to apply your backup |
| 136 | + policy. |
| 137 | + |
| 138 | + To learn more about the other parameters for a backup schedule |
| 139 | + see :ref:`atlasbackupschedule-custom-resource`. |
| 140 | + |
| 141 | + **Example:** |
| 142 | + |
| 143 | + .. code-block:: sh |
| 144 | + |
| 145 | + cat <<EOF | kubectl apply -f - |
| 146 | + apiVersion: atlas.mongodb.com/v1 |
| 147 | + kind: AtlasBackupSchedule |
| 148 | + metadata: |
| 149 | + name: "atlas-default-backupschedule" |
| 150 | + labels: |
| 151 | + app.kubernetes.io/version: 1.6.0 |
| 152 | + spec: |
| 153 | + autoExportEnabled: true |
| 154 | + copySettings: |
| 155 | + - cloudProvider: AWS |
| 156 | + frequencies: |
| 157 | + - HOURLY |
| 158 | + regionName: US_EAST_1 |
| 159 | + replicationSpecId: "string" |
| 160 | + shouldCopyOplogs: true |
| 161 | + referenceHourOfDay: 10 |
| 162 | + referenceMinuteOfHour: 10 |
| 163 | + restoreWindowDays: 2 |
| 164 | + policy: |
| 165 | + name: atlas-default-backuppolicy |
| 166 | + namespace: mongodb-atlas-system |
| 167 | + EOF |
| 168 | + |
| 169 | + .. step:: Apply the backup schedule to the {+cluster+}. |
| 170 | + |
| 171 | + In the :setting:`spec.backupRef.name` field of the |
| 172 | + :ref:`atlasdeployment-custom-resource`, specify the |
| 173 | + ``metadata.name`` from the |
| 174 | + :ref:`atlasbackupschedule-custom-resource` to apply your |
| 175 | + backup schedule to the {+cluster+}. |
| 176 | + |
| 177 | + **Example:** |
| 178 | + |
| 179 | + .. code-block:: sh |
| 180 | + |
| 181 | + cat <<EOF | kubectl apply -f - |
| 182 | + apiVersion: atlas.mongodb.com/v1 |
| 183 | + kind: AtlasDeployment |
| 184 | + metadata: |
| 185 | + name: my-atlas-cluster |
| 186 | + labels: |
| 187 | + app.kubernetes.io/version: 1.6.0 |
| 188 | + spec: |
| 189 | + backupRef: |
| 190 | + name: atlas-default-backupschedule |
| 191 | + namespace: mongodb-atlas-system |
| 192 | + EOF |
| 193 | + |
0 commit comments