Skip to content

Commit e726a25

Browse files
authored
(DOCSP-22471) Refactors TLS for OM application database (#1069)
* (DOCSP-22471) Refactors TLS for OM application database * Cleanup, adds missing setting in om spec * Includes changes from copy review * Includes change from tech review
1 parent d9824b9 commit e726a25

File tree

9 files changed

+181
-100
lines changed

9 files changed

+181
-100
lines changed

config/redirects

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,7 @@ raw: docs/kubernetes-operator/release-notes -> ${base}/stable/release-notes/
8787
# v1.15 and earlier
8888

8989
[*-v1.15]: docs/kubernetes-operator/${version}/third-party-integrations -> ${base}/${version}/
90+
91+
# All Versions
92+
93+
[*]: docs/kubernetes-operator/${version}/tutorial/secure-om-with-tls -> ${base}/${version}/tutorial/deploy-om-container

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
- :doc:`Install the Kubernetes Operator </tutorial/install-k8s-operator>`.
2-
3-
- :ref:`Deploy the Ops Manager application <deploy-om-container>` that
4-
you want to secure.
5-
1+
- Complete the :ref:`Prerequisites <om-rsrc-prereqs>`.
2+
- Read the :ref:`Considerations <om-rsrc-considerations>`.
63
- Create one |tls| certificate for the Application
74
Database's :term:`replica set`.
85

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

Lines changed: 97 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,44 @@ inherit:
55
file: steps-configure-kubectl-namespace.yaml
66
ref: configure-kubectl-namespace
77
---
8-
title: "Create a secret for your certificates."
8+
title: "Create secrets for your certificates."
99
stepnum: 2
1010
ref: create-cert-secret
1111
content: |
1212
13-
Once you have your |tls| certificate and Private Key, run the
14-
following command to store the certificates in a |k8s-secret|:
13+
.. include:: /includes/facts/fact-if-use-vault.rst
14+
.. include:: /includes/facts/fact-learn-more-secret-storage.rst
1515
16-
.. code-block:: sh
16+
a. Once you have your |tls| certificates and private keys, run the
17+
following command to create a |k8s-secret| that stores |onprem|\'s
18+
|tls| certificate:
19+
20+
.. code-block:: sh
21+
22+
kubectl create secret tls <prefix>-<metadata.name>-cert \
23+
--cert=<om-tls-cert> \
24+
--key=<om-tls-key>
25+
26+
b. Run the following command to create a new |k8s-secret| that stores
27+
the application database's |tls| certificate:
1728
18-
kubectl create secret tls <prefix>-<metadata.name>-cert \
19-
--cert=<om-tls-cert> \
20-
--key=<om-tls-key>
29+
.. code-block:: sh
30+
31+
kubectl create secret tls <prefix>-<metadata.name>-db-cert \
32+
--cert=<appdb-tls-cert> \
33+
--key=<appdb-tls-key>
2134
22-
.. include:: /includes/facts/fact-if-use-vault.rst
2335
---
24-
title: "If necessary, validate your TLS Certificate."
36+
title: "If necessary, validate your TLS certificates."
2537
stepnum: 3
2638
ref: validate-tls-cert
2739
content: |
2840
29-
If your |tls| certificate is signed by a Custom Certificate
41+
If your |onprem| |tls| certificate or your application database
42+
|tls| certificate is signed by a Custom Certificate
3043
Authority, you must provide a :abbr:`CA (Certificate Authority)`
31-
certificate to validate the |tls| certificate. To validate the
32-
|tls| certificate, create a |k8s-configmap| to hold the
44+
certificate to validate the |tls| certificate(s). To validate the
45+
|tls| certificate(s), create a |k8s-configmap| to hold the
3346
:abbr:`CA (Certificate Authority)` certificate:
3447
3548
.. warning::
@@ -41,10 +54,15 @@ content: |
4154
4255
.. important::
4356
44-
The |k8s-op-short| requires that the certificate is named
45-
``mms-ca.crt`` in the ConfigMap.
57+
The |k8s-op-short| requires that:
58+
59+
- Your |onprem| certificate is named ``mms-ca.crt`` in the
60+
ConfigMap.
61+
- Your application database certficate is named ``ca-pem`` in
62+
the ConfigMap.
4663
47-
a. Obtain the entire |tls| certificate chain from
64+
a. Obtain the entire |tls| certificate chain for both |onprem| and
65+
the application database from
4866
``downloads.mongodb.com``. The following ``openssl`` command
4967
outputs each certificate in the chain to your current working
5068
directory, in ``.crt`` format:
@@ -55,33 +73,48 @@ content: |
5573
-connect downloads.mongodb.com:443 -servername downloads.mongodb.com < /dev/null \
5674
| awk '/BEGIN/,/END/{ if(/BEGIN/){a++}; out="cert"a".crt"; print >out}'
5775
58-
#. Concatenate your |certauth|\'s certificate file with the
59-
entire |tls| certificate chain from ``downloads.mongodb.com`` that
76+
#. Concatenate your |certauth|\'s certificate file for |onprem|
77+
with the entire |tls| certificate chain from
78+
``downloads.mongodb.com`` that
6079
you obtained in the previous step:
6180
6281
.. code-block:: sh
6382
6483
cat cert1.crt cert2.crt cert3.crt cert4.crt >> mms-ca.crt
65-
#. Create the |k8s-configmap|:
84+
#. Concatenate your |certauth|\'s certificate file for the application
85+
database with the entire |tls| certificate chain from
86+
``downloads.mongodb.com`` that
87+
you obtained in the previous step:
88+
89+
.. code-block:: sh
90+
91+
cat cert1.crt cert2.crt cert3.crt cert4.crt >> ca-pem
92+
#. Create the |k8s-configmap| for |onprem|:
6693
6794
.. code-block:: sh
6895
6996
kubectl create configmap om-http-cert-ca --from-file="mms-ca.crt"
7097
98+
#. Create the |k8s-configmap| for the application database:
99+
100+
.. code-block:: sh
101+
102+
kubectl create configmap ca --from-file="ca-pem"
103+
71104
---
72105
title: "Copy the following example |onprem| |k8s| |k8s-obj|."
73106
stepnum: 4
74107
level: 4
75108
ref: copy-k8s-example
76109
content: |
77110
78-
Change the highlighted settings to match your desired
79-
|onprem| configuration.
111+
Change the highlighted settings to match your desired
112+
|onprem| and application database configuration.
80113
81-
.. literalinclude:: /reference/k8s/example-opsmgr-https.yaml
82-
:language: yaml
83-
:linenos:
84-
:emphasize-lines: 5,7-11,14-23,25-27
114+
.. literalinclude:: /reference/k8s/example-opsmgr-https.yaml
115+
:language: yaml
116+
:linenos:
117+
:emphasize-lines: 5,7-11,14-23,25-37
85118
---
86119
title: "Open your preferred text editor and paste the |k8s-obj| specification into a new text file."
87120
stepnum: 5
@@ -162,12 +195,14 @@ content: |
162195
| ``.tls``
163196
| ``.``:opsmgrkube:`~spec.security.tls.ca`
164197
- string
165-
- Name of the |k8s-configmap| you created to verify |tls|
198+
- Name of the |k8s-configmap| you created to verify your
199+
|onprem| |tls|
166200
certificates signed using a Custom Certificate Authority.
167201
168202
.. important::
169203
170-
This field is required if you signed your |tls|
204+
This field is required if you signed your
205+
|onprem| |tls|
171206
certificates using a Custom Certificate Authority.
172207
173208
- ``om-http-cert-ca``
@@ -220,6 +255,41 @@ content: |
220255
221256
- .. include:: /includes/facts/fact-which-appdb-version.rst
222257
258+
* - | ``spec``
259+
| ``.applicationDatabase``
260+
| ``.security``
261+
| ``.``:opsmgrkube:`~spec.applicationDatabase.security.certsSecretPrefix`
262+
- string
263+
- *Required*.
264+
265+
Text to prefix to the name of the secret that contains
266+
the application database's |tls| certificates.
267+
- ``appdb-prod``
268+
269+
* - | ``spec``
270+
| ``.applicationDatabase``
271+
| ``.security``
272+
| ``.tls``
273+
| ``.``:opsmgrkube:`~spec.applicationDatabase.security.tls.ca`
274+
- string
275+
- Name of the |k8s-configmap| you created to verify your
276+
application database |tls|
277+
certificates signed using a Custom Certificate Authority.
278+
279+
.. important::
280+
281+
This field is required if you signed your
282+
application database |tls|
283+
certificates using a Custom Certificate Authority.
284+
285+
- ``ca``
286+
287+
.. note::
288+
289+
The |k8s-op-short| mounts the |certauth| you add using the
290+
:opsmgrkube:`spec.applicationDatabase.security.tls.ca` setting to
291+
both the |onprem| and the Application Database pods.
292+
223293
---
224294
title: "Configure Backup settings"
225295
stepnum: 7
@@ -696,4 +766,5 @@ content: |
696766
697767
See :doc:`/reference/troubleshooting` for information about the
698768
resource deployment statuses.
769+
699770
...

source/includes/steps-secure-om-appdb.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
---
2-
ref: configure-kubectl-standalone
3-
stepnum: 1
4-
inherit:
5-
file: steps-configure-kubectl-namespace.yaml
6-
ref: configure-kubectl-namespace
71
---
82
ref: create-om-appdb-secret
93
stepnum: 2

source/om-resources.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ Deploy and Configure Ops Manager Resources
1616
prerequisites.
1717

1818
:ref:`deploy-om-container`
19-
Use the |k8s-op-short| to deploy an |onprem| instance.
19+
Use the |k8s-op-short| to deploy an |onprem| instance and encrypt the
20+
connection between the application database's replica set
21+
members.
2022

2123
:ref:`deploy-om-container-remote-mode`
2224
Use the |k8s-op-short| to configure |onprem| to operate in
@@ -49,5 +51,4 @@ Deploy and Configure Ops Manager Resources
4951
/tutorial/deploy-om-container
5052
/tutorial/deploy-om-container-remote-mode
5153
/tutorial/deploy-om-container-local-mode
52-
/tutorial/secure-om-with-tls
5354
/tutorial/configure-om-queryable-backups

source/reference/k8s-operator-om-specification.txt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,14 @@ Optional |onprem| Resource Settings
176176

177177
The default value is ``password``.
178178

179+
.. opsmgrkube:: spec.applicationDatabase.security.certsSecretPrefix
180+
181+
*Type*: string
182+
183+
Text to prefix to the name of the secret that contains the
184+
application database's |tls| certificate. Name the secret
185+
``<prefix>-<metadata.name>-db-cert``.
186+
179187
.. opsmgrkube:: spec.applicationDatabase.security.tls.ca
180188

181189
*Type*: string
@@ -1150,8 +1158,9 @@ snapshots, and secure connections to |s3| with |tls| using keys
11501158
issued by custom |certauth|.
11511159

11521160
To configure custom CA keys, use the ConfigMap with which you
1153-
configured |tls| for your application database as described in
1154-
`Create a ConfigMap That Contains the Certificate Authority <https://www.mongodb.com/docs/kubernetes-operator/stable/tutorial/secure-om-with-tls/#optional-create-a-configmap-that-contains-the-certificate-authority>`__.
1161+
configured |tls| for your application database as described on
1162+
the :guilabel:`TLS-Encrypted Connection (HTTPS)` tab of
1163+
:ref:`deploy-om-container`.
11551164
Set :opsmgrkube:`spec.applicationDatabase.security.tls.ca` to this ConfigMap.
11561165

11571166
You can use |tls| for both |s3| and your application database, or for

source/reference/k8s/example-opsmgr-https.yaml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,23 @@ spec:
1717
# the name of the secret that contains
1818
# Ops Manager's TLS certificate.
1919
tls:
20-
ca: <om-http-cert-ca> # Optional. Name of the ConfigMap file
20+
ca: "om-http-cert-ca" # Optional. Name of the ConfigMap file
2121
# containing the certificate authority that
2222
# signs the certificates used by the Ops
2323
# Manager custom resource.
2424

2525
applicationDatabase:
2626
members: 3
27-
version: <mongodbversion>
27+
version: "4.4.0-ent"
28+
security:
29+
certsSecretPrefix: <prefix> # Required. Text to prefix to the
30+
# name of the secret that contains the Application
31+
# Database's TLS certificate. Name the secret
32+
# <prefix>-<metadata.name>-db-cert.
33+
tls:
34+
ca: "appdb-ca" # Optional. Name of the ConfigMap file
35+
# containing the certicate authority that
36+
# signs the certificates used by the
37+
# application database.
2838

2939
...
Lines changed: 52 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
:noprevnext:
22

33
.. _deploy-om-container:
4+
.. _secure-om-db-tls:
45

56
===========================
67
Deploy an |onprem| Resource
@@ -18,40 +19,68 @@ Deploy an |onprem| Resource
1819

1920
You can deploy |onprem| in a container with the |k8s-op-short|.
2021

21-
Prerequisites and Considerations
22-
--------------------------------
22+
Considerations
23+
--------------
2324

24-
.. include:: /includes/deploy-om-prereqs.rst
25+
When you configure your |onprem| deployment, you must choose whether to run connections over |http| or |https|.
2526

26-
Considerations for |onprem| Deployments over HTTPS
27-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
27+
The following |http| procedure:
2828

29-
You can configure your deployed |onprem| resource to run over |https|,
30-
rather than |http|. A full description of TLS, PKI (Public Key
31-
Infrastructure) certificates, and Certificate Authority is beyond the
32-
scope of this tutorial. This tutorial assumes prior knowledge of TLS/SSL
33-
as well as access to valid certificates.
29+
- Doesn't encrypt connections to/from the |onprem| application.
30+
- Doesn't encrypt connections between the
31+
application database's replica set members.
32+
- Has fewer setup requirements.
3433

35-
When running over |https|, |onprem| runs on port ``8443`` by default.
34+
The following |https| procedure:
35+
36+
- Establishes |tls|-encrypted connections to/from the |onprem|
37+
application.
38+
- Establishes |tls|-encrypted connections between the application
39+
database's replica set members.
40+
- Requires valid certificates for |tls| encryption.
41+
42+
When running over |https|, |onprem| runs on port ``8443`` by
43+
default.
44+
45+
Select the appropriate tab based on whether you want to encrypt
46+
your |onprem| and application database connections with |tls|.
47+
48+
.. tabs::
49+
50+
.. tab:: Non-Encrypted Connections (HTTP)
51+
:tabid: http
52+
53+
Prerequisites
54+
-------------
55+
56+
.. include:: /includes/deploy-om-prereqs.rst
57+
58+
.. tab:: TLS-Encrypted Connections (HTTPS)
59+
:tabid: https
60+
61+
Prerequisites
62+
-------------
63+
64+
.. include:: /includes/prereqs/secure-om-resource.rst
3665

3766
Procedure
3867
---------
3968

40-
Select the appropriate tab based on whether you want your |onprem|
41-
instance to run over |http| or |https|:
42-
4369
.. tabs::
70+
:hidden:
71+
72+
.. tab:: Non-Encrypted Connection (HTTP)
73+
:tabid: http
4474

45-
tabs:
75+
Follow these steps to deploy the |onprem| resource to run over
76+
|http|:
4677

47-
- id: http
48-
name: HTTP
49-
content: |
78+
.. include:: /includes/steps/deploy-k8s-opsmgr-http.rst
5079

51-
.. include:: /includes/steps/deploy-k8s-opsmgr-http.rst
80+
.. tab:: TLS-Encrypted Connection (HTTPS)
81+
:tabid: https
5282

53-
- id: https
54-
name: HTTPS
55-
content: |
83+
Follow these steps to deploy the |onprem| resource to run over
84+
|https| and secure the application database using |tls|.
5685

57-
.. include:: /includes/steps/deploy-k8s-opsmgr-https.rst
86+
.. include:: /includes/steps/deploy-k8s-opsmgr-https.rst

0 commit comments

Comments
 (0)