Skip to content

Commit ab4a011

Browse files
JuliaMongojwilliams-mongo
authored andcommitted
(DOCSP-14366) TLS options adding/deprecating (#680)
* (DOCSP-14366) Initial commit. To be continued * Initial adding of information, after fixing the ticket's requirements * Fixing warnings in the build * Fixing syntax warnings * Added copy review from JW, and updated procedures for sharded clusters * Trying to fix the build warnings * Trying to fix syntax warnings * Fixed the build warnings gaa gst * Found more issues * Remove a typo * Fxing yet more issues * Fixing the example * This will never end * fixing warnings * fixing code highlighting * Friday portion of review, addressed additional issues that are not part of the initial ticket but are bugs in the docs, see comments in the pr * Went over examples to see that tls.ca is added to appdb security settings, and that secretRef.name is added to ops manager security settings as it is still used * Monday copy review * Making sure all names that changed are updated with prefix and -cert. Keeping other names as they are. * Copy edits and cleanup * Copy edits * Copy edits. Ready for Cian review * A few typos, a few clarifications, and reverting some metadata name to prefix changes from prev commit
1 parent 519162c commit ab4a011

33 files changed

+268
-126
lines changed
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
.. admonition:: Deprecation Notice
2-
:class: warning
1+
.. important:: Deprecation Notice
32

43
Automatically generating |tls| certificates with the |k8s-op-short|
54
is deprecated and will be removed in a future release.
65

7-
You must provide certificates from your own CA, as described in the
6+
You must provide certificates from your own CA, as described in the
87
following procedures, for production environments.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.. important:: Deprecation Notice
2+
3+
The :opsmgrkube:`spec.security.tls.secretRef.name` field is deprecated
4+
for the MongoDB resources and for the application database in the
5+
|onprem| resources. You can continue using :opsmgrkube:`spec.security.tls.secretRef.name`
6+
for the |onprem| resources other than the application database.
7+
8+
This field will remain in future releases to maintain backwards
9+
compatibility. Instead of the deprecated field, use:
10+
11+
- :opsmgrkube:`spec.applicationDatabase.security.tls.secretRef.prefix`,
12+
for the application database in your |onprem| resources.
13+
- :setting:`spec.security.tls.secretRef.prefix`, for MongoDB resources.
14+
15+

source/includes/code-examples/yaml-files/example-opsmgr.yaml

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,30 @@ spec:
1111
configuration:
1212
mms.fromEmailAddr: [email protected]
1313
mms.security.allowCORS: "false"
14+
security:
15+
tls:
16+
ca: "opsmgr-ca" # Optional. Name of the ConfigMap file
17+
# containing the certicate authority that
18+
# signs the certificates that the Ops Manager
19+
# resource uses.
20+
secretRef:
21+
name: "opsmgr" # Optional. Name of the secret for the
22+
# Ops Manager custom resource.
1423
applicationDatabase:
1524
members: 3
1625
version: "4.2.11-ent"
17-
security:
18-
tls:
19-
ca: "appdb-ca" # Optional. Name of the ConfigMap file
20-
# containing the certicate authority that
21-
# signs the certificates that the application
22-
# database uses.
23-
secretRef:
24-
name: "appdb-certs" # Name of the Secret object
26+
security:
27+
tls:
28+
ca: "appdb-ca" # Optional. Name of the ConfigMap file
29+
# containing the certicate authority that
30+
# signs the certificates used by the
31+
# application database.
32+
secretRef:
33+
prefix: "appdb" # Optional. The ``<prefix>`` of the
34+
# application database secret's name that
35+
# contains your MongoDB deployment's TLS
36+
# certificates. If you omit the prefix, this
37+
# setting defaults to the value of
38+
# metadata.name of the Ops Manager custom resource.
2539
...
2640
END-secure-appdb-full

source/includes/code-examples/yaml-files/example-replica-set.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,8 @@ spec:
412412
tls:
413413
enabled: true
414414
ca: <custom-ca>
415+
secretRef:
416+
prefix: <prefix>
415417
...
416418
END-tls-replset-full-custom
417419

@@ -438,6 +440,8 @@ START-tls-replset-lower-custom
438440
tls:
439441
enabled: true
440442
ca: <custom-ca>
443+
secretRef:
444+
prefix: <prefix>
441445
...
442446
END-tls-replset-lower-custom
443447

@@ -461,6 +465,8 @@ spec:
461465
tls:
462466
enabled: true
463467
ca: <custom-ca>
468+
secretRef:
469+
prefix: <prefix>
464470
authentication:
465471
enabled: true
466472
modes: ["X509"]
@@ -490,6 +496,8 @@ START-x509-client-replset-lower-custom
490496
tls:
491497
enabled: true
492498
ca: <custom-ca>
499+
secretRef:
500+
prefix: <prefix>
493501
authentication:
494502
enabled: true
495503
modes: ["X509"]
@@ -516,6 +524,8 @@ spec:
516524
tls:
517525
enabled: true
518526
ca: <custom-ca>
527+
secretRef:
528+
prefix: <prefix>
519529
authentication:
520530
enabled: true
521531
modes: ["X509"]
@@ -546,6 +556,8 @@ START-x509-internal-replset-lower-custom
546556
tls:
547557
enabled: true
548558
ca: <custom-ca>
559+
secretRef:
560+
prefix: <prefix>
549561
authentication:
550562
enabled: true
551563
modes: ["X509"]

source/includes/code-examples/yaml-files/example-sharded-cluster.yaml

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -249,27 +249,6 @@ spec:
249249
...
250250
END-auth-scram-x509-sharded
251251

252-
START-sharded
253-
---
254-
apiVersion: mongodb.com/v1
255-
kind: MongoDB
256-
metadata:
257-
name: <my-secure-sharded-cluster>
258-
spec:
259-
shardCount: 2
260-
mongodsPerShardCount: 3
261-
mongosCount: 2
262-
configServerCount: 3
263-
version: "4.2.2-ent"
264-
opsManager:
265-
configMapRef:
266-
name: <configMap.metadata.name>
267-
# Must match metadata.name in ConfigMap file
268-
credentials: <mycredentials>
269-
type: ShardedCluster
270-
persistent: true
271-
...
272-
END-minimal-sharded
273252

274253
START-scaled-sharded
275254
---
@@ -316,6 +295,8 @@ spec:
316295
tls:
317296
enabled: true
318297
ca: <custom-ca>
298+
secretRef:
299+
prefix: <prefix>
319300
...
320301
END-tls-sharded-full-custom
321302

@@ -345,6 +326,8 @@ START-tls-sharded-lower-custom
345326
tls:
346327
enabled: true
347328
ca: <custom-ca>
329+
secretRef:
330+
prefix: <prefix>
348331
...
349332
END-tls-sharded-lower-custom
350333

@@ -371,6 +354,8 @@ spec:
371354
tls:
372355
enabled: true
373356
ca: <custom-ca>
357+
secretRef:
358+
prefix: <prefix>
374359
authentication:
375360
enabled: true
376361
modes: ["X509"]
@@ -403,6 +388,8 @@ START-x509-client-sharded-lower-custom
403388
tls:
404389
enabled: true
405390
ca: <custom-ca>
391+
secretRef:
392+
prefix: <prefix>
406393
authentication:
407394
enabled: true
408395
modes: ["X509"]
@@ -432,6 +419,8 @@ spec:
432419
tls:
433420
enabled: true
434421
ca: <custom-ca>
422+
secretRef:
423+
prefix: <prefix>
435424
authentication:
436425
enabled: true
437426
modes: ["X509"]
@@ -465,6 +454,8 @@ START-x509-internal-sharded-lower-custom
465454
tls:
466455
enabled: true
467456
ca: <custom-ca>
457+
secretRef:
458+
prefix: <prefix>
468459
authentication:
469460
enabled: true
470461
modes: ["X509"]

source/includes/list-tables/resource-keys-tls-custom-ca.rst

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.. list-table::
2-
:widths: 20 10 10 40 20
2+
:widths: 25 10 10 40 15
33
:header-rows: 1
44

55
* - Key
@@ -26,3 +26,13 @@
2626
- If you use a custom |certauth| and have created the
2727
|k8s-configmap| that stores it, add the ConfigMap's name.
2828
- ``<custom-ca>``
29+
30+
* - | ``spec.security``
31+
| :setting:`.tls.secretRef.prefix<spec.security.tls.secretRef.prefix>`
32+
- string
33+
- Optional
34+
- Add the ``<prefix>`` of the |k8s| |k8s-secret| name that contains
35+
your MongoDB deployment's |tls| certificates. If you omit this
36+
setting, the prefix defaults to the value of
37+
:setting:`metadata.name` of your MongoDB resource.
38+
- ``<prefix>``

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,20 @@ inherit:
477477
file: options-k8s-shared.yaml
478478
---
479479
program: k8sRsConf
480+
name: spec.security.tls.secretRef.name
481+
inherit:
482+
name: spec.security.tls.secretRef.name
483+
program: _shared
484+
file: options-k8s-shared.yaml
485+
---
486+
program: k8sRsConf
487+
name: spec.security.tls.secretRef.prefix
488+
inherit:
489+
name: spec.security.tls.secretRef.prefix
490+
program: _shared
491+
file: options-k8s-shared.yaml
492+
---
493+
program: k8sRsConf
480494
name: spec.security.authentication.modes
481495
inherit:
482496
name: spec.security.authentication.modes

source/includes/options-k8s-shared.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,29 @@ description: |
572572
Provide the name of the |k8s-configmap| that stores the |certauth|.
573573
---
574574
program: _shared
575+
name: spec.security.tls.secretRef.name
576+
type: string
577+
directive: setting
578+
optional: true
579+
description: |
580+
Deprecated. Use :setting:`spec.security.tls.secretRef.prefix` instead.
581+
Provide the name of the |k8s| |k8s-secret| you created that contains
582+
your MongoDB deployment's |tls| certificates.
583+
---
584+
program: _shared
585+
name: spec.security.tls.secretRef.prefix
586+
type: string
587+
directive: setting
588+
optional: true
589+
description: |
590+
Provide the ``<prefix>`` of the |k8s| |k8s-secret| name that you
591+
created that contains your MongoDB deployment's |tls| certificates.
592+
The full |k8s-secret| name has the following format:
593+
``<prefix>-cert``. If you omit this setting, the prefix
594+
defaults to the value of :setting:`metadata.name` of your
595+
|k8s-mdbrsc|.
596+
---
597+
program: _shared
575598
name: spec.security.authentication
576599
type: collection
577600
directive: setting

source/includes/prereqs/custom-ca-prereqs-naming-conventions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111

1212
- Replace ``<X>`` with the member of a shard or replica set.
1313

14-
- End the |pem| files with ``-pem`` and *not* ``.pem``.
14+
- End the files with ``-cert`` and *not* ``.cert``.
1515
These files shouldn't have a file extension.

source/includes/prereqs/custom-ca-prereqs-rs-tls-only.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
* - Your custom |certauth|
1010
- ``ca-pem``
1111
* - Each member of your replica set
12-
- ``<metadata.name>-<X>-pem``
12+
- ``<metadata.name>-<X>-cert``
1313

1414
.. include:: /includes/prereqs/pem-file-description.rst
1515

1616
.. include:: /includes/prereqs/custom-ca-prereqs-naming-conventions.rst
1717

18-
.. admonition:: About the Domain Names in certificates
18+
.. note:: About the Domain Names in certificates
1919

2020
.. include:: /includes/prereqs/pem-file-domain-name.rst

source/includes/prereqs/custom-ca-prereqs-rs-tls-x509-internal.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* - Your custom |certauth|
1010
- ``ca-pem``
1111
* - Each member of your replica set
12-
- ``<metadata.name>-<X>-pem``
12+
- ``<metadata.name>-<X>-cert``
1313
* - Your project's Automation or MongoDB Agent
1414
- ``mms-automation-agent-pem``
1515
* - Your project's Backup Agent (if needed)

source/includes/prereqs/custom-ca-prereqs-sc-tls-only.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
* - Your custom |certauth|
1010
- ``ca-pem``
1111
* - Each shard in your sharded cluster
12-
- ``<metadata.name>-<Y>-<X>-pem``
12+
- ``<metadata.name>-<Y>-<X>-cert``
1313
* - Each member of your config server replica set
14-
- ``<metadata.name>-config-<X>-pem``
14+
- ``<metadata.name>-config-<X>-cert``
1515
* - Each |mongos|
16-
- ``<metadata.name>-mongos-<X>-pem``
16+
- ``<metadata.name>-mongos-<X>-cert``
1717

1818
.. include:: /includes/prereqs/custom-ca-prereqs-naming-conventions.rst

source/includes/prereqs/custom-ca-prereqs-sc-tls-x509-internal.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
* - Your custom |certauth|
1010
- ``ca-pem``
1111
* - Each shard in your sharded cluster
12-
- ``<metadata.name>-<Y>-<X>-pem``
12+
- ``<metadata.name>-<Y>-<X>-cert``
1313
* - Each member of your config server replica set
14-
- ``<metadata.name>-config-<X>-pem``
14+
- ``<metadata.name>-config-<X>-cert``
1515
* - Each |mongos|
16-
- ``<metadata.name>-mongos-<X>-pem``
16+
- ``<metadata.name>-mongos-<X>-cert``
1717
* - Your project's Automation or MongoDB Agent
1818
- ``mms-automation-agent-pem``
1919
* - Your project's Backup Agent (if needed)

source/includes/prereqs/custom-ca-prereqs.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@
99
* - Your custom |certauth|
1010
- ``ca-pem``
1111
* - Each member of your replica set
12-
- ``<metadata.name>-<X>-pem``
12+
- ``<metadata.name>-<X>-cert``
1313
* - Your project's Automation or MongoDB Agent
1414
- ``mms-automation-agent-pem``
1515
* - Your project's Backup Agent (if needed)
1616
- ``mms-backup-agent-pem``
1717
* - Your project's Monitoring Agent (if needed)
1818
- ``mms-monitoring-agent-pem``
1919
* - Each shard in your sharded cluster
20-
- ``<metadata.name>-<Y>-<X>-pem``
20+
- ``<metadata.name>-<Y>-<X>-cert``
2121
* - Each member of your config server replica set
22-
- ``<metadata.name>-config-<X>-pem``
22+
- ``<metadata.name>-config-<X>-cert``
2323
* - Each |mongos|
24-
- ``<metadata.name>-mongos-<X>-pem``
24+
- ``<metadata.name>-mongos-<X>-cert``
2525

2626
.. include:: /includes/prereqs/custom-ca-prereqs-naming-conventions.rst

source/includes/prereqs/secure-om-resource.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515
* - DNS Names
1616
- Each certificate must include a |san-dns| or Subject Name
1717
with the name of the |k8s-pod| in |k8s|. These names must
18-
resemble this format:
18+
use this format:
1919

2020
.. code-block:: sh
2121
2222
<opsmgr-name>-db-<index>.<opsmgr-name>-db-svc.<namespace>.svc.cluster.local
2323
2424
* - Key Usages
25-
- MongoDB requires the |tls| certs to include two specific
25+
- MongoDB requires the |tls| certificates to include two specific
2626
key-usages (:rfc:`5280 <5280#section-4.2.1.3>`):
2727

2828
- "server auth"

source/includes/steps-deploy-k8s-opsmgr-http.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -509,16 +509,18 @@ content: |
509509
Create this database as a :ref:`replica set
510510
<deploy-replica-set>`.
511511
512+
.. include:: /includes/admonitions/deprecate-secret-ref-name.rst
513+
512514
Match the ``metadata.name`` of the resource with the
513-
:opsmgrkube:`spec.backup.opLogStores.mongodbResourceRef.name` that you specified
514-
in your |onprem| resource definition.
515+
:opsmgrkube:`spec.backup.opLogStores.mongodbResourceRef.name`
516+
that you specified in your |onprem| resource definition.
515517
516518
#. Choose one of the following:
517519
518520
i. Deploy a :ref:`MongoDB database resource
519521
<k8s-deploy-mdb-resources>` for the blockstore in the
520522
same namespace as the |onprem| resource.
521-
523+
522524
Match the ``metadata.name`` of the resource to the
523525
:opsmgrkube:`spec.backup.blockStores.mongodbResourceRef.name`
524526
that you specified in your |onprem| resource definition.

0 commit comments

Comments
 (0)