Skip to content

Commit b7872b3

Browse files
(DOCSP-9612): Split Horizons tutorial needs to be fixed (#222)
* (DOCSP-9612): Split Horizons tutorial needs to be fixed * (DOCSP-9612): tech review feedback * (DOCSP-9612): more tech review updates * (DOCSP-9612): more tech review * (DOCSP-9612): fix steps * (DOCSP-9612): last tech review feedback
1 parent 2bf64c3 commit b7872b3

File tree

4 files changed

+107
-43
lines changed

4 files changed

+107
-43
lines changed

source/includes/code-examples/responses/k8s-cert-output.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,13 @@ my-secure-rs-1.mongodb 31s system:serviceaccount:mong
124124
my-secure-rs-2.mongodb 24s system:serviceaccount:mongodb:mongodb-enterprise-operator Pending
125125
END-output-k8s-rs-tls-csrs
126126

127+
START-output-k8s-rs-tls-csrs-approved
128+
NAME AGE REQUESTOR CONDITION
129+
my-secure-rs-0.mongodb 33s system:serviceaccount:mongodb:mongodb-enterprise-operator Approved, Issued
130+
my-secure-rs-1.mongodb 31s system:serviceaccount:mongodb:mongodb-enterprise-operator Approved, Issued
131+
my-secure-rs-2.mongodb 24s system:serviceaccount:mongodb:mongodb-enterprise-operator Approved, Issued
132+
END-output-k8s-rs-tls-csrs-approved
133+
127134
START-output-k8s-rs-x509-csrs
128135
NAME AGE REQUESTOR CONDITION
129136
mms-automation-agent.mongodb 15m system:serviceaccount:mongodb:mongodb-enterprise-operator Approved,Issued

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,18 @@ START-horizon-addcert-replset-lower
368368
...
369369
END-horizon-addcert-replset-lower
370370

371+
START-horizon-addcert-replset-random-ports
372+
security:
373+
tls:
374+
enabled: true
375+
connectivity:
376+
replicaSetHorizons:
377+
- "example-website": "web1.example.com:10017"
378+
- "example-website": "web2.example.com:10017"
379+
- "example-website": "web3.example.com:10017"
380+
...
381+
END-horizon-addcert-replset-random-ports
382+
371383
START-horizon-addcert-replset-lower-nodeports
372384
security:
373385
tls:

source/includes/steps-enable-split-horizon.yaml

Lines changed: 88 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,50 @@
1+
---
2+
title: If you haven't done so already, deploy a replica with the |k8s-op-short|.
3+
stepnum: 1
4+
level: 4
5+
ref: pre-deploy-replicaset
6+
content: |
7+
8+
Follow the instructions to :ref:` deploy a replica set
9+
<deploy-replica-set>`. To simplify the configuration, don't enable
10+
|tls| with the :setting:`spec.security.tls.enabled` setting.
11+
12+
---
13+
title: "If you already deployed a replica set with the |k8s-op-short| with |tls| enabled, remove the |csrs| for each host in your deployment."
14+
level: 4
15+
ref: remove-tls-existing-replicasets
16+
stepnum: 2
17+
optional: true
18+
content: |
19+
a. Invoke the following command to retrieve the |csrs| for each host:
20+
21+
.. code-block:: sh
22+
23+
kubectl get csr
24+
25+
The command's output resembles the following:
26+
27+
.. literalinclude:: /includes/code-examples/responses/k8s-cert-output.sh
28+
:language: sh
29+
:copyable: false
30+
:start-after: START-output-k8s-rs-tls-csrs-approved
31+
:end-before: END-output-k8s-rs-tls-csrs-approved
32+
33+
#. Repeat the following command for each host in your deployment to
34+
remove the |csrs|:
35+
36+
.. code-block:: none
37+
38+
kubectl delete my-secure-rs-0.mongodb
39+
40+
.. important::
41+
42+
Remove only the |tls| |csrs|. Don't remove X.509 or any other
43+
|csrs|.
44+
---
145
title: Create a NodePort for each |k8s-pod|.
246
level: 4
3-
stepnum: 1
47+
stepnum: 3
448
ref: k8s-ext-rs-create-nodeports
549
content: |
650
@@ -15,7 +59,7 @@ content: |
1559
---
1660
title: Discover the dynamically assigned NodePorts.
1761
level: 4
18-
stepnum: 2
62+
stepnum: 4
1963
ref: k8s-ext-rs-discover-nodeports
2064
content: |
2165
@@ -30,16 +74,13 @@ content: |
3074
<my-replica-set>-svc ClusterIP None <none> 27017/TCP 38m
3175
3276
NodePorts range from 30000 to 32767, inclusive.
33-
3477
---
3578
title: "Open your replica set resource |yaml| file."
3679
level: 4
37-
stepnum: 3
80+
stepnum: 5
3881
ref: open-replset-resource
39-
content: |
40-
4182
---
42-
stepnum: 4
83+
stepnum: 6
4384
ref: copy-k8s-example-rs
4485
source:
4586
file: steps-source-deploy-k8s-resource.yaml
@@ -60,15 +101,14 @@ replacement:
60101
61102
.. literalinclude:: /includes/code-examples/yaml-files/example-replica-set.yaml
62103
:language: yaml
63-
:start-after: START-horizon-addcert-replset-lower
64-
:end-before: END-horizon-addcert-replset-lower
104+
:start-after: START-horizon-addcert-replset-random-ports
105+
:end-before: END-horizon-addcert-replset-random-ports
65106
:linenos:
66107
:lineno-start: 15
67108
:emphasize-lines: 1-8
68-
69109
---
70110
level: 4
71-
stepnum: 5
111+
stepnum: 7
72112
ref: paste-k8s-example-rs
73113
source:
74114
file: steps-source-deploy-k8s-resource.yaml
@@ -79,26 +119,29 @@ replacement:
79119
---
80120
title: "Change the highlighted settings to your preferred values."
81121
level: 4
82-
stepnum: 6
122+
stepnum: 8
83123
ref: change-replset-resource
84124
content: |
85125
86126
.. include:: /includes/list-tables/resource-keys-split-horizons.rst
87127
88128
---
89-
title: Add the ports for external connectivity.
129+
title: Confirm the external hostnames and NodePort values in your replica set resource.
90130
level: 4
91-
stepnum: 7
92-
ref: k8s-ext-rs-update-ports
131+
stepnum: 9
132+
ref: k8s-ext-rs-confirm-hostnames
93133
content: |
94134
95-
Set the ports to the NodePort values that you set for the
96-
``example-website`` connectivity setting.
135+
Confirm that the external hostnames in the
136+
:setting:`spec.connectivity.replicaSetHorizons` setting are correct.
97137
98138
External hostnames should match the |dns| names of |k8s| worker
99139
nodes. These can be *any* nodes in the |k8s| cluster. |k8s-nodes| do
100140
internal routing if the pod is run on another node.
101141
142+
Set the ports in :setting:`spec.connectivity.replicaSetHorizons` to
143+
the NodePort values that you discovered.
144+
102145
.. example::
103146
104147
.. literalinclude:: /includes/code-examples/yaml-files/example-replica-set.yaml
@@ -109,15 +152,9 @@ content: |
109152
:lineno-start: 15
110153
:emphasize-lines: 6-8
111154
112-
.. note::
113-
114-
You may need to delete each |k8s-pod|, then change the horizon
115-
values, and then reapply. |k8s-op-short| then reconfigures the
116-
horizons.
117-
118155
---
119156
level: 4
120-
stepnum: 8
157+
stepnum: 10
121158
ref: save-object-spec-rs
122159
source:
123160
file: steps-source-deploy-k8s-resource.yaml
@@ -126,28 +163,47 @@ replacement:
126163
k8sResource: :term:`replica set`
127164
---
128165
level: 4
129-
stepnum: 9
130-
ref: start-k8s-deployment-rs
166+
stepnum: 11
167+
ref: restart-k8s-deployment-rs
131168
source:
132169
file: steps-source-deploy-k8s-resource.yaml
133170
ref: restart-k8s-deployment
134171
replacement:
135172
k8sResource: :term:`replica set`
136173
k8sResourceType: replica-set
137174
---
175+
stepnum: 12
138176
level: 4
139-
stepnum: 10
140-
ref: track-k8s-deployment-rs
177+
ref: check-k8s-deployment-rs-tls
141178
source:
142179
file: steps-source-deploy-k8s-resource.yaml
143-
ref: track-k8s-deployment-basic
180+
ref: check-k8s-deployment
181+
---
182+
stepnum: 13
183+
level: 4
184+
ref: get-csrs-rs-tls
185+
source:
186+
file: steps-source-deploy-k8s-resource.yaml
187+
ref: get-csrs
144188
replacement:
145-
k8sResource: :term:`replica set`
146-
189+
k8sResource: replica set
190+
startTag: START-output-k8s-rs-tls-csrs
191+
endTag: END-output-k8s-rs-tls-csrs
192+
---
193+
stepnum: 14
194+
level: 4
195+
ref: approve-csrs-rs-tls
196+
source:
197+
file: steps-source-deploy-k8s-resource.yaml
198+
ref: approve-host-csrs
199+
replacement:
200+
k8sResource: replica set
201+
startTag: START-input-k8s-rs-csrs
202+
endTag: END-input-k8s-rs-csrs
147203
---
148204
title: Test the connection to the replica set.
149205
level: 4
150-
stepnum: 11
206+
stepnum: 15
151207
ref: k8s-ext-rs-test-conn
152208
content: |
153209

source/tutorial/connect-from-outside-k8s.txt

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -62,17 +62,6 @@ from outside of the |k8s| cluster depends on the resource.
6262
external connectivity. Other utilities can be used in
6363
production.
6464

65-
This procedure uses the following example:
66-
67-
.. literalinclude:: /includes/code-examples/yaml-files/example-replica-set.yaml
68-
:language: yaml
69-
:start-after: START-horizon-addcert-replset
70-
:end-before: END-horizon-addcert-replset
71-
:linenos:
72-
:lineno-start: 1
73-
:copyable: false
74-
:emphasize-lines: 16-22
75-
7665
To connect to your |k8s-op-short|-deployed MongoDB replica set
7766
resource from outside of the |k8s| cluster:
7867

0 commit comments

Comments
 (0)