Skip to content

Commit fdd7b55

Browse files
sarahsimpersjwilliams-mongo
authored andcommitted
(DOCSP-20045) Adds includes about secret storage wherever docs talk about K8s secrets (#780)
* (DOCSP-20045) Adds includes about secret storage wherever docs talk about K8s secrets * Adds more includes * Adds tutorial to add secrets to Vault * Adds link to create vault secret in more places * Adds include file, updates other pages * Rebasing * Adds more changes to TLS pages * Includes changes from copy review * Adds YAML steps file for procedure
1 parent 0e0a6db commit fdd7b55

26 files changed

+281
-56
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
If you're using |hashicorp-vault| as your :ref:`secret storage tool <k8s-secret-storage>`,
2+
you can :ref:`Create a Vault Secret <create-vault-secret>` instead.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
To learn about your options for secret
2+
storage, see :ref:`Configure Secret Storage <k8s-set-secret-storage-tool>`.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@
3131
| :setting:`.tls.certsSecretPrefix<spec.security.tls.certsSecretPrefix>`
3232
- string
3333
- Optional
34-
- If applicable, add the ``<prefix>`` of the |k8s| |k8s-secret|
34+
- If applicable, add the ``<prefix>`` of the secret
3535
name that contains your MongoDB deployment's |tls| certificates.
3636
- ``devDb``

source/includes/list-tables/rs-resource-base-options.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757

5858
* - :setting:`spec.credentials`
5959
- string
60-
- Name of the |k8s| |k8s-secret| you
60+
- Name of the secret you
6161
:ref:`created <create-k8s-secret>` as |mms| |api|
6262
authentication credentials for the |k8s-op-short| to
6363
communicate with |onprem|.

source/includes/prereqs-deploy-resource.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,13 @@ following procedures:
55

66
- :ref:`create-k8s-project`
77

8-
- :ref:`create-k8s-credentials`
8+
- :ref:`create-k8s-credentials` or
9+
:ref:`configure a different secret storage tool <k8s-set-secret-storage-tool>`
910

1011
Alternatively, for |cloud|, after installing the Kubernetes Operator,
1112
you can use the |cloud-short| :cloudmgr:`UI
1213
</tutorial/nav/k8s-config-for-mdb-resource/>` to automatically generate
1314
the ConfigMap and Kubernetes secret YAML files, which you can then
14-
apply to your Kubernetes environment.
15+
apply to your Kubernetes environment.
16+
17+
.. include:: /includes/facts/fact-can-change-secret-storage-tool.rst

source/includes/steps-add-database-user-scram.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ content: |
5151
5252
* - ``spec.passwordSecretKeyRef.name``
5353
- string
54-
- ``metadata.name`` value of the |k8s-secret| that stores the
54+
- ``metadata.name`` value of the secret that stores the
5555
user's password.
5656
- ``my-resource``
5757

source/includes/steps-add-database-user-secret-scram.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ ref: paste-k8s-secret
4040
content: |
4141
a. Open your preferred text editor.
4242
b. Paste this User Secret into a new text file.
43+
44+
.. include:: /includes/facts/fact-if-use-vault.rst
45+
46+
.. include:: /includes/facts/fact-learn-more-secret-storage.rst
4347
---
4448
title: "Change the highlighted lines."
4549
level: 4

source/includes/steps-configure-om-queryable-backups.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ content: |
3636
3737
kubectl create secret generic queryable-pem --from-file=./queryable.pem
3838
39+
.. include:: /includes/facts/fact-if-use-vault.rst
40+
41+
.. include:: /includes/facts/fact-learn-more-secret-storage.rst
3942
---
4043
title: "Mount the Secret as a volume that |onprem| custom objects will use."
4144
stepnum: 4
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
---
2+
stepnum: 1
3+
level: 4
4+
ref: have-keys
5+
title: "Obtain the |onprem| public and private Keys."
6+
content: |
7+
8+
Make sure you have the public and private keys for your desired
9+
|onprem| |svc-api-key|.
10+
11+
---
12+
stepnum: 2
13+
level: 4
14+
ref: create-vault-secret
15+
title: "Create the secret in |vault-short|."
16+
content: |
17+
18+
Invoke the following |vault-short| command to create your secret, replacing
19+
the variables with the values in the table:
20+
21+
.. list-table::
22+
:widths: 30 70
23+
:header-rows: 1
24+
25+
* - Placeholder
26+
- Description
27+
28+
* - {Namespace}
29+
- Label that identifies the namespace where you deployed |k8s-op-short|.
30+
31+
* - {SecretName}
32+
- Human-readable label that identifies the secret you're creating in |vault-short|.
33+
34+
* - {PublicKey}
35+
- The public key for your desired |onprem| |svc-api-key|.
36+
37+
* - {PrivateKey}
38+
- The private key for your desired |onprem| |svc-api-key|.
39+
40+
.. code-block:: sh
41+
42+
vault kv put secret/data/mongodbenterprise/operator/{Namespace}/{SecretName} publicKey={PublicKey} privateKey={PrivateKey}
43+
44+
The path in this command is the default path. You can replace ``mongodbenterprise/operator`` with
45+
your base path if you customized your |k8s-op-short| configuration.
46+
47+
---
48+
stepnum: 3
49+
level: 4
50+
ref: verify-vault-secret
51+
title: "Verify the |vault-short| secret creation was successful."
52+
content: |
53+
54+
Invoke the following |vault-short| command to verify your secret, replacing
55+
the variables with the values in the following table:
56+
57+
.. list-table::
58+
:widths: 30 70
59+
:header-rows: 1
60+
61+
* - Placeholder
62+
- Description
63+
64+
* - {Namespace}
65+
- Label that identifies the namespace where you deployed |k8s-op-short|.
66+
67+
* - {SecretName}
68+
- Human-readable label that identifies the secret you're creating in |vault-short|.
69+
70+
.. code-block:: sh
71+
72+
vault kv get secret/data/mongodbenterprise/operator/{Namespace}/{SecretName}
73+
74+
This command returns a secret description in the shell:
75+
76+
.. code-block:: sh
77+
78+
====== Metadata ======
79+
Key Value
80+
--- -----
81+
created_time 2021-12-15T17:20:22.985303Z
82+
deletion_time n/a
83+
destroyed false
84+
version 1
85+
86+
======= Data =======
87+
Key Value
88+
--- -----
89+
publicKey {PublicKey}
90+
privateKey {PrivateKey}
91+
...

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ content: |
7474
7575
* - :opsmgrkube:`spec.adminCredentials`
7676
- string
77-
- Name of the |k8s-secret| you :ref:`created <om-rsrc-prereqs>`
77+
- Name of the secret you :ref:`created <om-rsrc-prereqs>`
7878
for the |onprem| admin user.
7979
8080
.. note::
@@ -213,7 +213,7 @@ content: |
213213
| ``.s3SecretRef``
214214
| ``.``:opsmgrkube:`~spec.backup.s3Stores.s3SecretRef.name`
215215
- string
216-
- Name of the |k8s-secret| that contains the ``accessKey`` and
216+
- Name of the secret that contains the ``accessKey`` and
217217
``secretKey`` fields. The :ref:`backup-daemon` uses the
218218
values of these fields as credentials to access the |s3| or
219219
|s3|-compatible bucket.
@@ -439,8 +439,8 @@ ref: create-credentials
439439
content: |
440440
441441
If you enabled Backup, you must create an |onprem| organization,
442-
generate programmatic API keys, and create a |k8s-secret|. These
443-
activities follow the prerequisites and procedure on the
442+
generate programmatic API keys, and create a secret in your :ref:`secret-storage-tool <k8s-set-secret-storage-tool>`.
443+
These activities follow the prerequisites and procedure on the
444444
:ref:`create-k8s-credentials` page.
445445
446446
---

0 commit comments

Comments
 (0)