Skip to content

Commit 76aa008

Browse files
authored
(DOCSP-13276) Enable programmatic backups via CRD YAML file configuration (#433)
* (DOCSP-13276) Enable programmatic backups via CRD YAML file configuration * (DOCSP-13276) Continuous backup options in CRD, added copy review from JW * (DOCSP-13276) continuous backup in CRD: tech review first pass
1 parent 1a04c1b commit 76aa008

File tree

6 files changed

+96
-24
lines changed

6 files changed

+96
-24
lines changed

source/includes/options-k8s-replica-set.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,26 @@ replacement:
115115

116116
---
117117
program: k8sRsConf
118+
name: spec.backup.mode
119+
type: string
120+
directive: setting
121+
optional: true
122+
inherit:
123+
name: spec.backup.mode
124+
program: _shared
125+
file: options-k8s-shared.yaml
126+
---
127+
program: k8sRsConf
128+
name: spec.backup
129+
type: collection
130+
directive: setting
131+
optional: true
132+
inherit:
133+
name: spec.backup
134+
program: _shared
135+
file: options-k8s-shared.yaml
136+
---
137+
program: k8sRsConf
118138
name: spec.persistent
119139
type: boolean
120140
directive: setting

source/includes/options-k8s-shared.yaml

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ description: |
9191
Name of |k8s| service to be created or used for a
9292
|k8s-statefulset|. If the service with this name already exists, the
9393
|k8s-op-full| does not delete or recreate it. This setting lets
94-
users to create their custom services and lets the Operator reuse
95-
them.
94+
users to create their custom services and lets the |k8s-op-short|
95+
reuse them.
9696
9797
---
9898
program: _shared
@@ -103,7 +103,7 @@ optional: true
103103
default: cluster.local
104104
description: |
105105
106-
Domain name of the |k8s| cluster where you deploy the Operator. When
106+
Domain name of the |k8s| cluster where you deploy the |k8s-op-short|. When
107107
|k8s| creates a |k8s-statefulset|, the |k8s| assigns each |k8s-pod| a
108108
|fqdn|. To update |com|, the |k8s-op-short| calculates the |fqdn| for
109109
each |k8s-pod| using a provided cluster name. |k8s| doesn't provide
@@ -126,13 +126,44 @@ pre: |
126126
Use :setting:`spec.clusterDomain` instead.
127127
description: |
128128
129-
Domain name of the |k8s| cluster where you deploy the Operator. When
130-
|k8s| creates a |k8s-statefulset|, the |k8s| assigns each |k8s-pod| a
131-
|fqdn|. To update |com|, the |k8s-op-short| calculates the |fqdn| for
129+
Domain name of the |k8s| cluster where you deploy the |k8s-op-short|.
130+
When |k8s| creates a |k8s-statefulset|, the |k8s| assigns each |k8s-pod|
131+
a |fqdn|. To update |com|, the |k8s-op-short| calculates the |fqdn| for
132132
each |k8s-pod| using a provided cluster name. |k8s| doesn't provide
133133
an |api| to query these hostnames.
134134
135135
.. include:: /includes/admonitions/warning-set-cluster-name.rst
136+
---
137+
program: _shared
138+
name: spec.backup.mode
139+
type: string
140+
directive: setting
141+
description: |
142+
143+
Enables continuous backups for a MongoDB resource.
144+
Possible values are :code:`ENABLED`, :code:`DISABLED`, and
145+
:code:`TERMINATED`.
146+
147+
.. note::
148+
The :code:`spec.backup.mode`
149+
setting relies on :ref:`Backup <om-rsrc-backup>` that is
150+
enabled in the |onprem| and requires that
151+
:opsmgrkube:`spec.backup.enabled`
152+
value in the |onprem| :ref:`resource specification
153+
<k8s-om-specification>` is set to :code:`true`.
154+
155+
After you enable continuous backups for your MongoDB resource with
156+
:code:`spec.backup.mode`, you can :ref:`check the backup status <get-resource-status>`.
157+
158+
---
159+
program: _shared
160+
name: spec.backup
161+
type: collection
162+
directive: setting
163+
description: |
164+
165+
The collection container for :setting:`spec.backup.mode`,
166+
which enables continuous backups for MongoDB resources in |k8s-op-short|.
136167
137168
---
138169
program: _shared
@@ -350,7 +381,7 @@ description: |
350381
.. seealso::
351382
352383
The |k8s| documentation for use cases on
353-
`affinity and anti-affinity <https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#more-practical-use-cases>`__
384+
`affinity and anti-affinity <https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#more-practical-use-cases>`__.
354385
355386
---
356387
program: _shared

source/includes/options-k8s-standalone.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ inherit:
121121
name: spec.clusterName
122122
program: _shared
123123
file: options-k8s-shared.yaml
124-
125124
---
125+
126126
program: k8sSaConf
127127
name: spec.opsManager.configMapRef.name
128128
type: string

source/includes/steps-source-deploy-k8s-resource.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ content: |
151151
|k8s-obj| specification file for a {{k8sResource}} deployment:
152152
153153
- :setting:`spec.additionalMongodConfig`
154+
- :setting:`spec.backup.mode`
154155
- :setting:`spec.clusterDomain`
155156
- :setting:`spec.featureCompatibilityVersion`
156157
- :setting:`spec.logLevel`
@@ -176,13 +177,13 @@ content: |
176177
|k8s-obj| specification file for a :term:`sharded cluster`
177178
deployment:
178179
180+
- :setting:`spec.backup.mode`
179181
- :setting:`spec.clusterDomain`
180182
- :setting:`spec.exposedExternally`
181183
- :setting:`spec.logLevel`
182184
- :setting:`spec.featureCompatibilityVersion`
183185
- :setting:`spec.connectivity.replicaSetHorizons`
184186
185-
186187
.. include:: /includes/admonitions/warning-set-cluster-name.rst
187188
188189
**For config server**

source/reference/k8s-operator-specification.txt

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ Optional
8383

8484
Every resource type may use the following settings:
8585

86-
.. include:: /includes/option/setting-k8sSaConf-metadata.namespace.rst
8786
.. include:: /includes/option/setting-k8sSaConf-spec.featureCompatibilityVersion.rst
8887
.. include:: /includes/option/setting-k8sSaConf-spec.clusterDomain.rst
8988
.. include:: /includes/option/setting-k8sSaConf-spec.clusterName.rst
89+
.. include:: /includes/option/setting-k8sSaConf-metadata.namespace.rst
9090
.. include:: /includes/option/setting-k8sSaConf-spec.service.rst
9191
.. include:: /includes/option/setting-k8sSaConf-spec.logLevel.rst
9292
.. include:: /includes/option/setting-k8sSaConf-spec.security.authentication.ignoreUnknownUsers.rst
@@ -141,19 +141,27 @@ Replica Set Settings
141141
All of the :ref:`standalone-settings` also apply to replica set
142142
resources.
143143

144-
The following settings only apply to replica set resource types:
144+
The following settings apply only to replica set resource types:
145145

146+
.. include:: /includes/option/setting-k8sRsConf-spec.backup.rst
147+
.. include:: /includes/option/setting-k8sRsConf-spec.backup.mode.rst
148+
.. include:: /includes/option/setting-k8sSaConf-spec.clusterDomain.rst
149+
.. include:: /includes/option/setting-k8sSaConf-spec.clusterName.rst
150+
.. include:: /includes/option/setting-k8sRsConf-spec.connectivity.replicaSetHorizons.rst
151+
.. include:: /includes/option/setting-k8sSaConf-spec.featureCompatibilityVersion.rst
146152
.. include:: /includes/option/setting-k8sRsConf-spec.members.rst
147153
.. include:: /includes/option/setting-k8sRsConf-spec.podSpec.podAntiAffinityTopologyKey.rst
148-
.. include:: /includes/option/setting-k8sRsConf-spec.connectivity.replicaSetHorizons.rst
154+
149155

150156
.. _sharded-cluster-settings:
151157

152158
Sharded Cluster Settings
153159
~~~~~~~~~~~~~~~~~~~~~~~~
154160

155-
The following settings only apply to sharded cluster resource types:
161+
The following settings apply only to sharded cluster resource types:
156162

163+
.. include:: /includes/option/setting-k8sRsConf-spec.backup.rst
164+
.. include:: /includes/option/setting-k8sRsConf-spec.backup.mode.rst
157165
.. include:: /includes/option/setting-k8sSaConf-spec.exposedExternally.rst
158166
.. include:: /includes/option/setting-k8sScConf-spec.configServerCount.rst
159167
.. include:: /includes/option/setting-k8sScConf-spec.configSrv.additionalMongodConfig.rst
@@ -213,9 +221,10 @@ The following settings only apply to sharded cluster resource types:
213221
Security Settings
214222
-----------------
215223

216-
The following security settings only apply to replica set and sharded
224+
The following security settings apply only to replica set and sharded
217225
cluster resource types:
218226

227+
219228
.. include:: /includes/option/setting-k8sRsConf-spec.security.tls.enabled.rst
220229
.. include:: /includes/option/setting-k8sRsConf-spec.security.tls.ca.rst
221230
.. include:: /includes/option/setting-k8sRsConf-spec.security.tls.additionalCertificateDomains.rst

source/reference/troubleshooting.txt

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,20 @@ The following key-value pairs describe the resource deployment statuses:
109109
* - ``link``
110110
- Deployment |url| in |mms|.
111111

112+
* - ``backup.statusName``
113+
- If you enabled continuous backups with :setting:`spec.backup.mode`
114+
in |k8s| for your MongoDB resource, this field indicates
115+
the status of the backup, such as ``backup.statusName:"STARTED"``.
116+
Possible values are ``STARTED``, ``STOPPED``, and ``TERMINATED``.
117+
112118
* - Resource specific fields
113119
- For descriptions of these fields, see
114120
:doc:`/reference/k8s-operator-specification`.
115121

116122
.. example::
117123

118-
If you want to see what the status of a replica set named
119-
``my-replica-set`` in the ``developer`` namespace, run:
124+
To see the status of a replica set named ``my-replica-set`` in
125+
the ``developer`` namespace, run:
120126

121127
.. code-block:: sh
122128

@@ -192,8 +198,7 @@ invoke this command:
192198

193199
.. example::
194200

195-
If your :term:`replica set` is labeled ``myrs``, the |k8s-pod| log
196-
command is invoked as:
201+
If your :term:`replica set` is labeled ``myrs``, run:
197202

198203
.. code-block:: sh
199204

@@ -214,7 +219,7 @@ To view all |k8s-mdbrsc| specifications in the provided
214219

215220
.. example::
216221

217-
To read details about the ``dublin`` standalone resource, invoke
222+
To read details about the ``dublin`` standalone resource, run
218223
this command:
219224

220225
.. code-block:: shell
@@ -279,7 +284,7 @@ those pods.
279284
my-replica-set-2 0/1 Pending 0 2h
280285

281286
``my-replica-set-2`` is stuck in the ``Pending`` stage. To gather
282-
more data on the error, run the following:
287+
more data on the error, run:
283288

284289
.. code-block:: sh
285290
:copyable: false
@@ -289,7 +294,9 @@ those pods.
289294

290295
<describe output omitted>
291296

292-
Warning FailedScheduling 15s (x3691 over 3h) default-scheduler 0/3 nodes are available: 1 node(s) had taints that the pod didn't tolerate, 2 Insufficient memory.
297+
Warning FailedScheduling 15s (x3691 over 3h) default-scheduler
298+
0/3 nodes are available: 1 node(s) had taints that the pod
299+
didn't tolerate, 2 Insufficient memory.
293300

294301
The output indicates an error in memory allocation.
295302

@@ -321,14 +328,18 @@ those pods.
321328
Replace a ConfigMap to Reflect Changes
322329
---------------------------------------
323330

324-
If you are unable to modify or redeploy an already-deployed configMap file using the *kubectl apply* command, invoke the following:
331+
If you cannot modify or redeploy an already-deployed resource
332+
:file:`ConfigMap` file using the *kubectl apply* command, run:
325333

326334
.. code-block:: shell
327335

328336
kubectl replace -f <my-config-map>.yaml
329337

330-
This will delete and re-create a resource. This command is useful in cases where you need to update resource files that cannot be updated
331-
once initialized or want to make an immediate recursive change.
338+
This deletes and re-creates the :file:`ConfigMap` resource file.
339+
340+
This command is useful in cases where you want to make an immediate
341+
recursive change, or you need to update resource files that cannot
342+
be updated once initialized.
332343

333344
Remove |k8s| Components
334345
-----------------------

0 commit comments

Comments
 (0)